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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
SarveshRealign
New Member

Linking all information to each row - Need to associate each Name with all Trainings Available

I am trying to associate each Participants Name with all Trainings available.

I have this:

Participants NameTrainingDate
A

Training-1

1/10/2020

BTraining-23/10/2020
CTraining-37/10/2020


I need this as output:

Participants NameTrainingDate
ATraining-11/10/2020
A

Training-2

null

ATraining-3null
BTraining-1null
BTraining-23/10/2020
BTraining-3null
CTraining-1null
CTraining-2null
CTraining-37/10/2020


How do I proceed?

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@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"

Fowmy_0-1639036807991.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@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"

Fowmy_0-1639036807991.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


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_0-1639040131918.png

 

@SarveshRealign 

You can add it from Add Columns

Fowmy_0-1639053002234.png

Then,

Add the code, make sure you tye the previous step in your query, in my case Changed Type:

Fowmy_1-1639053053102.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.