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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Iamnvt
Continued Contributor
Continued Contributor

Combine common values in Power Query

hi,

 

I have a Column:

A, B
B, C
A, C
D, E, F
D, E, G

 

how can I combine the 2 rows into one row in Power Query, if they have any value common: 

Expected result: 

 

A, BA, B, C
B, CA, B, C
A, CA, B, C
D, E, FD, E, F, G
D, E, GD, E, F, G

 

Thanks

 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Iamnvt

A bit more steps needed to implement, please see my pbix to catch the idea.

If you have any problem, please feel free to ask me.

 7.png

Best Regards

Maggie

 

Iamnvt
Continued Contributor
Continued Contributor

hi @v-juanli-msft,

 

thank you for your solution. I checked it, and have few comments:

1. If I change the sequence of the values in column1, this is not working anymore. Eg:

A, BA, B, C
D, E, FD, E, F, G
A, CA, B, C
B, CA, B, C
D, E, GD, E, F, G

 

2. This solution is little bit brute force. My problem is not limited in 3 values in one column,  but could extend to many values.

 

Is there any generalized approach to address this problem?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.