+ Reply to Thread
Results 1 to 13 of 13

Power Query Formula Inserting Custom text

  1. #1
    Registered User
    Join Date
    07-02-2019
    Location
    Romania
    MS-Off Ver
    Latest
    Posts
    24

    Power Query Formula Inserting Custom text

    Hello everyone,

    While using power query, I am looking for a formula that will insert text into the rows below its column, I can't figure out how the formula should be and I am working with two worksheets, one is for Project A and the other is for Project B.

    I want the formula to check if there is any text on the next rows and display a custom text.

    Can you help ?

    Much obliged !
    Attached Files Attached Files
    Last edited by Rastancu; 10-28-2019 at 07:51 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: [Power Query Formula] Inserting Custom text

    Will you please attach a small sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    Instructions (Please Read Carefully):

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment (it hasn't worked for years, and despite our repeatedly asking the technical team who own the forum to fix it, they can't be bothered to do so), so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-02-2019
    Location
    Romania
    MS-Off Ver
    Latest
    Posts
    24

    Re: [Power Query Formula] Inserting Custom text

    Thank you AliGW, document is now attached !

    - forgot how to attach, apologies, now it's attached on the first post, thank you again !

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: [Power Query Formula] Inserting Custom text

    No, it isn't ...

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: Power Query Formula Inserting Custom text

    You have not shown us what you are trying to achieve - please manually mock up what you want and repost the workbook.

  6. #6
    Registered User
    Join Date
    07-02-2019
    Location
    Romania
    MS-Off Ver
    Latest
    Posts
    24

    Re: Power Query Formula Inserting Custom text

    Is the new version ok now ?

    Using PQ I've appended two tables, I've added to each table an extra custom column where I wish to insert a text formula to display a custom text so that in the appended table it will appear with both table's formula results.

    I hope this covers what I need, it's the first time when I work with Power Query.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: Power Query Formula Inserting Custom text

    Not really!

    What is the custom text you want to show? That's what you need to mock up.

  8. #8
    Registered User
    Join Date
    07-02-2019
    Location
    Romania
    MS-Off Ver
    Latest
    Posts
    24

    Re: Power Query Formula Inserting Custom text

    Oh ! I understand now, I've changed it to "return text "cba", in table 1 and table 2, I need a formula that inserts text "abc" for table 1 and "cba" for table 2.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: Power Query Formula Inserting Custom text

    No, we aren't there yet. This is not what you really want to see, is it?

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    21
    Column1 Column2 Column3 Column4 Column5 Column to insert Formula Column to insert formula2
    22
    A B C D E Return Text "ABC"
    23
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    24
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    25
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    26
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    27
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    28
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    29
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    30
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    31
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    32
    53141
    53142
    53143
    53144
    53145
    Return Text "ABC"
    33
    1
    2
    3
    4
    5
    Return text "cba"
    34
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    35
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    36
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    37
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    38
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    39
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    40
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    41
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    42
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    43
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    44
    3543
    3544
    3545
    3546
    3547
    Return text "cba"
    Sheet: Sheet1

    I need to know EXACTLY what you are aiming for. Mock it up MANUALLY - never mind Power Query for now.

  10. #10
    Registered User
    Join Date
    07-02-2019
    Location
    Romania
    MS-Off Ver
    Latest
    Posts
    24

    Re: Power Query Formula Inserting Custom text

    You are right, yes all on the same column, I believe now it's correct and on par.
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: Power Query Formula Inserting Custom text

    I'm still not convinced you are telling us what we need to know.

    Have a look at the attached - is it what you want?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-02-2019
    Location
    Romania
    MS-Off Ver
    Latest
    Posts
    24

    Re: Power Query Formula Inserting Custom text

    Not quite, the results are indeed what I need but I need a formula that can give me those values, the formula needs to work in power query editor, I saw that they are a bit different than normal excel formulas.

    Then in Table 1, I will use the formula to insert "ABC" and in Table 2 to insert "CBA".

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,941

    Re: Power Query Formula Inserting Custom text

    Yes, but how is Excel meant to work out what you want??? What relevance do those text strings have in each table? What formula are you talking about?

    You need to be completely clear: mock up the two source tables as you want them to be prior to merging.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  2. [SOLVED] Power Query Custom Column Formula
    By whiskeybravo91 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-06-2018, 11:10 AM
  3. Power Query Custom Column Formula
    By whiskeybravo91 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2018, 09:57 AM
  4. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  5. [SOLVED] Power Query Custom Column: If number in columns a or b are less than 1 then 0 else 1
    By jekeith in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-15-2018, 10:31 AM
  6. Power Query - Invoke Custom Function
    By leukep in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2017, 02:18 PM
  7. Help with Power Query Custom Column Formula
    By travis.cook21 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-16-2016, 01:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1