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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rchiang
Frequent Visitor

Combining 2 columns into 1 new long column

Good Morning,

 

I'm currently trying to combine 2 columns with the same drop down options (so same text datasets) so I can use a visualization to see the total amount of times each categories were used. Each line is linked to the accounts those categories were featured at. 

 

So I want to be able to see 1 visualization with the accounts down 1 axis and the categories on the other axis. 

 

 2 text column to 1.jpg

 

Thanks! 

1 ACCEPTED SOLUTION

HI @rchiang,


Maybe you can try to use unpivot table feature to convert these columns to key and value columns, then remove duplicate records. After these steps, you will get merge records.

Power Query Unpivot Scenario

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @rchiang,

 

You can try to use below formula to get merged unique list:

NewTable =
DISTINCT (
    UNION ( VALUES ( 'Table'[Product1] ), VALUES ( 'Table'[Product2] ) )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msftXiaoxin,

 

Thank you for your help for that.

 

I should have showed the actual table I want combined

2017-11-27_10-28-54.jpg

 

I want to have 1 column that will show the account with category .

 

So it would be 

Column 1 / Column 2 

PCM US / Docks and Hubs

PCM US / Racks and Enclosures 

 

Thanks again! 

Would that be possible? 

HI @rchiang,


Maybe you can try to use unpivot table feature to convert these columns to key and value columns, then remove duplicate records. After these steps, you will get merge records.

Power Query Unpivot Scenario

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft,

 

Thank you so much for the uppivot suggestion it worked out perfectly.

 

Thanks! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.