Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
AtifMahmood
New Member

Combining Columns

Hi All

I have a table with columns "ITMDESC". I am adding a new column by searching a word from the ITMDESC and adding new columns with the searched name. like I am searching "SWITCH" from ITMDESC, if it is there it will write SWITCH in the column else "N". 

now I have three new columns, SWITCH, DAMPER, and FLANGE. what I need is to combine all three columns into one new column, where "N" is not there and only words like "SWITCH" or DAMPER or FLANGE will come from the columns. 

AtifMahmood_0-1686557049935.png

 

hope you understand.

Thanks in advance. 

 

Atif 

 

 

1 ACCEPTED SOLUTION

@AtifMahmood ,

  Sorry for the inconvenience. Please use the below code . It will work for sure.

CombinedColumn = 
IF(
    CONTAINSSTRING('Table'[itemdesc], "Switch"),
    "Switch",
    IF(
        CONTAINSSTRING('Table'[itemdesc], "Damper"),
        "Damper",
        IF(
            CONTAINSSTRING('Table'[itemdesc], "Flange"),
            "Flange",
            "N"
        )
    )
)

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

3 REPLIES 3
AjithPrasath
Resolver II
Resolver II

@AtifMahmood ,

   You can use the below code:

CombinedColumn = 
CONCATENATEX(
    'YourTable',
    IF('YourTable'[SWITCH] = "N", "", 'YourTable'[SWITCH]) & 
    IF('YourTable'[DAMPER] = "N", "", 'YourTable'[DAMPER]) & 
    IF('YourTable'[FLANGE] = "N", "", 'YourTable'[FLANGE]),
    ", "
)

It will combine three columns into single column.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

thanks for your reply but this code

CombinedColumn = CONCATENATEX( 'Table1 (2)', IF('Table1 (2)'[SWITCH] = "N", "", 'Table1 (2)'[SWITCH]) & IF('Table1 (2)'[DAMPER] = "N", "", 'Table1 (2)'[DAMPER]) & IF('Table1 (2)'[FLANGE] = "N", "", 'Table1 (2)'[FLANGE]), ", " )
 is giving data like that.
AtifMahmood_0-1686566932840.png

what I need is that the new column just does not display "N". it will just display "Switch" or "Damper" or "Flanage" or whatever item is there in the ROW from columns. 

 

Hope i make you understand 

 

Thanks

@AtifMahmood ,

  Sorry for the inconvenience. Please use the below code . It will work for sure.

CombinedColumn = 
IF(
    CONTAINSSTRING('Table'[itemdesc], "Switch"),
    "Switch",
    IF(
        CONTAINSSTRING('Table'[itemdesc], "Damper"),
        "Damper",
        IF(
            CONTAINSSTRING('Table'[itemdesc], "Flange"),
            "Flange",
            "N"
        )
    )
)

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.