+ Reply to Thread
Results 1 to 4 of 4

Add separator while merging columns if condition met in Power Query

  1. #1
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Add separator while merging columns if condition met in Power Query

    In Power Query while merging multiple columns, can I create code to only add a separator (comma) if value occurs in columns?

    Columns A, B, C, and D have names of individuals. I would like to merge all 3 columns to 1 with a comma separating each column entry. Some cells in columns may be empty resulting in an output such as below:

    Name1,,,Name4


    Current code I am using:

    #"Merged Columns" = Table.CombineColumns(#"Expanded Clean Name1",{"Name1", "Name2", "Name3"},Combiner.CombineTextByDelimiter(",", QuoteStyle.None),"Name")


    Any suggestion? Thanks!
    Last edited by JyothiGrace; 12-17-2022 at 10:12 AM.

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add separator while merging columns if condition met in Power Query

    try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Re: Add separator while merging columns if condition met in Power Query

    Thanks again Sandy. You just helped my team finish off a week long project in only 4 days!

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add separator while merging columns if condition met in Power Query

    My pleasure

+ 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. Power Query custom formula not working for 1 single condition
    By Izzii0x in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-27-2021, 03:08 AM
  2. [SOLVED] Power Query Wrong Merging (fuzzymerge with 1 result)
    By Imbizile in forum Excel General
    Replies: 11
    Last Post: 12-16-2020, 04:58 AM
  3. [SOLVED] Power Query merging
    By Imbizile in forum Excel General
    Replies: 7
    Last Post: 05-09-2020, 08:59 AM
  4. 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
  5. Power query and decimal separator
    By mikla90 in forum Excel General
    Replies: 4
    Last Post: 07-11-2019, 01:47 PM
  6. 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
  7. Power Query Solution for merging data
    By kersplash in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-23-2018, 12:40 AM

Tags for this Thread

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