Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
This seems kind of unique, but may not be. I'm in a new role and learning Power BI.
I have a table of information coming from a dataflow set to automatically update. I need to use this as a dimension table, however some items have multiple entries (because of multiple accessories) and I need to clean the data in order to reach a one to many relationship.
Basically I am looking to have the 2nd and 3rd Accessory feed into additional columns.
To simplify, this is the start:
| Item | Accessory |
| Item 1 | Accessory 1A |
| Item 2 | Accessory 2A |
| Item 2 | Accessory 2B |
| Item 3 | Accessory 3A |
| Item 3 | Accessory 3B |
| Item 3 | Accessory 3C |
| Item 4 | Accessory 4A |
| Item 5 | Accessory 5A |
| Item 5 | Accessory 5B |
| Item 6 | Accessory 6A |
and this is my desired result:
| Item | 1st Acc | 2nd Acc | 3rd Acc |
| Item 1 | Accessory 1A | ||
| Item 2 | Accessory 2A | Accessory 2B | |
| Item 3 | Accessory 3A | Accessory 3B | Accessory 3C |
| Item 4 | Accessory 4A | ||
| Item 5 | Accessory 5A | Accessory 5B | |
| Item 6 | Accessory 6A |
Thanks for the help in advance!
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8ixJzVUwVNJRckxOTi0uzi+qVDB0VIrVgcoYocgY4ZZxQsgYo8gYO+KUwa3HGSFjgiJjgmSaKYqMKW4ZJHvMUGTMgHpiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Accessory = _t]),
#"Grouped Rows" = Table.Group(Source, {"Item"}, {{"ar", each Table.Transpose(Table.SelectColumns(_, {"Accessory"}))}}),
#"Expanded ar" = Table.ExpandTableColumn(#"Grouped Rows", "ar", {"Column1", "Column2", "Column3"}, {"Acc1", "Acc2", "Acc3"})
in
#"Expanded ar"
| 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("i45W8ixJzVUwVNJRckxOTi0uzi+qVDB0VIrVgcoYocgY4ZZxQsgYo8gYO+KUwa3HGSFjgiJjgmSaKYqMKW4ZJHvMUGTMgHpiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Accessory = _t]),
#"Grouped Rows" = Table.Group(Source, {"Item"}, {{"ar", each Table.Transpose(Table.SelectColumns(_, {"Accessory"}))}}),
#"Expanded ar" = Table.ExpandTableColumn(#"Grouped Rows", "ar", {"Column1", "Column2", "Column3"}, {"Acc1", "Acc2", "Acc3"})
in
#"Expanded ar"
| 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! |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!