Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
My input value is like this
| Product Quality |
| apple_high |
| apple_medium,apple_low,apple_high |
| apple_low,orange_high,mango_low |
| mango_high,orange_medium |
| orange_low,mango_low |
I wanted my output to look like the below table
| Product | High | Medium | low |
| apple | 2 | 1 | 2 |
| orange | 1 | 1 | 1 |
| mango | 1 | 0 | 2 |
Need some help on how to create a measure for this quer
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSiwoyEmNz8hMz1CK1YFxc1NTMktzdSCcnPxyHayqQBL5RYl56RAZnVwgMx8kClYD4YEloIogpoIloSIgE5B0xQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Product Quality" = _t]),
Split = Table.TransformColumns(Source, {"Product Quality", each Table.FromRows(List.Transform(Text.Split(_,","), each Text.Split(Text.Trim(_), "_")), {"Brand", "Quality"})}),
#"Expanded Product Quality" = Table.ExpandTableColumn(Split, "Product Quality", {"Brand", "Quality"}, {"Brand", "Quality"}),
#"Duplicated Column" = Table.DuplicateColumn(#"Expanded Product Quality", "Brand", "Brand - Copy"),
#"Pivoted Column" = Table.Pivot(#"Duplicated Column", List.Distinct(#"Duplicated Column"[Quality]), "Quality", "Brand - Copy", List.Count)
in
#"Pivoted Column"
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSiwoyEmNz8hMz1CK1YFxc1NTMktzdSCcnPxyHayqQBL5RYl56RAZnVwgMx8kClYD4YEloIogpoIloSIgE5B0xQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Product Quality" = _t]),
Split = Table.TransformColumns(Source, {"Product Quality", each Table.FromRows(List.Transform(Text.Split(_,","), each Text.Split(Text.Trim(_), "_")), {"Brand", "Quality"})}),
#"Expanded Product Quality" = Table.ExpandTableColumn(Split, "Product Quality", {"Brand", "Quality"}, {"Brand", "Quality"}),
#"Duplicated Column" = Table.DuplicateColumn(#"Expanded Product Quality", "Brand", "Brand - Copy"),
#"Pivoted Column" = Table.Pivot(#"Duplicated Column", List.Distinct(#"Duplicated Column"[Quality]), "Quality", "Brand - Copy", List.Count)
in
#"Pivoted Column"
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |