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.
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)
ID | Aggregated_Ethnicity | Aggregated_Ethnicity_Group |
1 | New Zealand European/Pakeha | European |
2 | New Zealand European/Pakeha;New Zealand Maori | European; Maori |
3 | British/Irish;New Zealand European/Pakeha | European |
4 | Indian;New Zealand European/Pakeha;Other | Asian; European; Other |
Output I want
ID | Aggregated_Ethnicity | Aggregated_Ethnicity_Group |
1 | New Zealand European/Pakeha | European |
2 | New Zealand European/Pakeha | European |
2 | New Zealand Maori | Maori |
3 | British/Irish | European |
3 | New Zealand European/Pakeha | European |
4 | Indian | Asian |
4 | New Zealand European/Pakeha | European |
4 | Other | Other |
Solved! Go to Solution.
@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]
Then duplicate your table, and split columns and merge tables. For more details, please review attached PBIX file.
Regards,
Lydia
@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]
Then duplicate your table, and split columns and merge tables. For more details, please review attached PBIX file.
Regards,
Lydia
Thanks Lydia
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |