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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to Merge two different Collumns and add values to them

Hi everyone! I hope you are doing fine!

 

I need to merge two different tables and add values to one of them to each value I have in the dimesion table. For example:

 

In one table I have the name of the training and who did it.  

martinstronic_1-1643299203611.png

 

In the other, I have the name of the Trainings:

martinstronic_2-1643299962870.png

What I need is to discover what training were not done yet:

 

martinstronic_3-1643300151569.png

In this case, I know that the blank rows is the missing trainings.

 

Is that a way to do this with DAX or M? I've tried several forms using union, except, join in DAX and All the merge options in Power Query, but I have success only using 1 number. 

 

Let me know if you need some extra info. Thanks!


https://drive.google.com/file/d/1Jha1Pgxr-_erpdomTIEwriC2QVdtHEbF/view?usp=sharing 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

This can be done in Power Query, here is one possible implementation:

let
    Fonte = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwMFTSUQopSszMy8xLN1SK1cEQNMImaIxN0ASboClM0AibRUbYLDIipN0cJmiM6qRYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Number = _t, Training = _t]),
    #"Grouped Rows" = Table.Group(Fonte, {"Number"}, {{"Rows", each _, type table [Number=nullable text, Training=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Ref", each Trainings),
    #"Expanded Ref" = Table.ExpandTableColumn(#"Added Custom", "Ref", {"All Trainings"}, {"All Trainings"}),
    #"Added Custom1" = Table.AddColumn(#"Expanded Ref", "Training", each if List.Contains([Rows][Training],[All Trainings]) then [All Trainings] else null),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom1",{"Number", "All Trainings", "Training"})
in
    #"Removed Other Columns"

 

See attached.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

This can be done in Power Query, here is one possible implementation:

let
    Fonte = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjAwMFTSUQopSszMy8xLN1SK1cEQNMImaIxN0ASboClM0AibRUbYLDIipN0cJmiM6qRYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Number = _t, Training = _t]),
    #"Grouped Rows" = Table.Group(Fonte, {"Number"}, {{"Rows", each _, type table [Number=nullable text, Training=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Ref", each Trainings),
    #"Expanded Ref" = Table.ExpandTableColumn(#"Added Custom", "Ref", {"All Trainings"}, {"All Trainings"}),
    #"Added Custom1" = Table.AddColumn(#"Expanded Ref", "Training", each if List.Contains([Rows][Training],[All Trainings]) then [All Trainings] else null),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom1",{"Number", "All Trainings", "Training"})
in
    #"Removed Other Columns"

 

See attached.

Anonymous
Not applicable

Hey Ibendlin! Thank you so much for this!

 

It was exactly what I was in need! Have a nice week!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors