Join 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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I am trying to associate each Participants Name with all Trainings available.
I have this:
| Participants Name | Training | Date |
| A | Training-1 | 1/10/2020 |
| B | Training-2 | 3/10/2020 |
| C | Training-3 | 7/10/2020 |
I need this as output:
| Participants Name | Training | Date |
| A | Training-1 | 1/10/2020 |
| A | Training-2 | null |
| A | Training-3 | null |
| B | Training-1 | null |
| B | Training-2 | 3/10/2020 |
| B | Training-3 | null |
| C | Training-1 | null |
| C | Training-2 | null |
| C | Training-3 | 7/10/2020 |
How do I proceed?
Solved! Go to Solution.
@SarveshRealign
I used Power Query to do the transformation.
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes given below and follow the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCkgsKslMzixIzCspVvBLzE1V0lEKKUrMzMvMSwcyXRJLUpVidaKVHJHEdQ2BHEN9QwN9IwMjA7C0E7K0EZBjjCLtjCxtDOSYI6RjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Participants Name", type text}, {"Training", type text}, {"Date", type date}},"en-gb"),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each #"Changed Type1"[Training]),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Added Custom1" = Table.AddColumn(#"Expanded Custom", "Custom.1", each if [Training] = [Custom] then [Date] else null),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Training", "Date"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Training"}, {"Custom.1", "Date"}}),
#"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
#"Changed Type2"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@SarveshRealign
I used Power Query to do the transformation.
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes given below and follow the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCkgsKslMzixIzCspVvBLzE1V0lEKKUrMzMvMSwcyXRJLUpVidaKVHJHEdQ2BHEN9QwN9IwMjA7C0E7K0EZBjjCLtjCxtDOSYI6RjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Participants Name", type text}, {"Training", type text}, {"Date", type date}},"en-gb"),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each #"Changed Type1"[Training]),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Added Custom1" = Table.AddColumn(#"Expanded Custom", "Custom.1", each if [Training] = [Custom] then [Date] else null),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Training", "Date"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Training"}, {"Custom.1", "Date"}}),
#"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
#"Changed Type2"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Fowmy
Thanks a lot, you did produce what I needed.
However, can you explain how you add Custom column?
@SarveshRealign
You can add it from Add Columns
Then,
Add the code, make sure you tye the previous step in your query, in my case Changed Type:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
| User | Count |
|---|---|
| 21 | |
| 13 | |
| 8 | |
| 6 | |
| 4 |
| User | Count |
|---|---|
| 49 | |
| 41 | |
| 37 | |
| 16 | |
| 13 |