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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RickL
Frequent Visitor

Split several columns at once into rows

I have a dataset with multiple concatenated fields and I need to split them into rows based on the delimiter (some cases a semicolon, others a comma). 

 

Report format (input)

IDAggregated_EthnicityAggregated_Ethnicity_Group
1New Zealand European/PakehaEuropean
2New Zealand European/Pakeha;New Zealand MaoriEuropean; Maori
3British/Irish;New Zealand European/PakehaEuropean
4Indian;New Zealand European/Pakeha;OtherAsian; European; Other

 

Output I want

IDAggregated_EthnicityAggregated_Ethnicity_Group
1New Zealand European/PakehaEuropean
2New Zealand European/PakehaEuropean
2New Zealand MaoriMaori
3British/IrishEuropean
3New Zealand European/PakehaEuropean
4IndianAsian
4New Zealand European/PakehaEuropean
4OtherOther
1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@RickL,

Add a cutsom column in your table.

if Text.Contains([Aggregated_Ethnicity], ";")=true and  Text.Contains([Aggregated_Ethnicity_Group], ";")=false then [Aggregated_Ethnicity_Group] &";"&[Aggregated_Ethnicity_Group]else [Aggregated_Ethnicity_Group]

1.PNG

Then duplicate your table, and split columns and merge tables. For more details, please review attached PBIX file.
1.PNG2.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@RickL,

Add a cutsom column in your table.

if Text.Contains([Aggregated_Ethnicity], ";")=true and  Text.Contains([Aggregated_Ethnicity_Group], ";")=false then [Aggregated_Ethnicity_Group] &";"&[Aggregated_Ethnicity_Group]else [Aggregated_Ethnicity_Group]

1.PNG

Then duplicate your table, and split columns and merge tables. For more details, please review attached PBIX file.
1.PNG2.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Lydia

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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