Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Need to create dax query or Mquery to join two tables SCD and Fosa on the key Internal_Key which is acomposite key formed with
Solved! Go to Solution.
Hi @Anonymous
I’ve created 2 tables as requested, both of them added the calculated column “Internal_Key”, and we’d like to merge them based on that special column.
Assuming Fosa as the left table, and SCD as the right one.
Table 2 = ADDCOLUMNS(Fosa,"SCD.WP ID",RELATED(SCD[WP ID]),"SCD.Stivhtag",RELATED(SCD[Stichtag]),"SCD.Depot",RELATED(SCD[Depot]),"SCD.Internal Key",RELATED(SCD[Internal_Key]))
2. Using Merge option id query editor:
Create the custom column in both 2 tables using M code:
= Table.AddColumn(#"Changed Type1", "Custom", each Text.Combine({[Stichtag],"_",[Depot],"_",[WP ID]}))
And then Merge them using M code:
= Table.ExpandTableColumn(Source, "SCD", {"Stichtag", "Depot", "WP ID", "Custom"}, {"SCD.Stichtag", "SCD.Depot", "SCD.WP ID", "SCD.Custom"})
Regards,
Dina
Hi @Anonymous
I’ve created 2 tables as requested, both of them added the calculated column “Internal_Key”, and we’d like to merge them based on that special column.
Assuming Fosa as the left table, and SCD as the right one.
Table 2 = ADDCOLUMNS(Fosa,"SCD.WP ID",RELATED(SCD[WP ID]),"SCD.Stivhtag",RELATED(SCD[Stichtag]),"SCD.Depot",RELATED(SCD[Depot]),"SCD.Internal Key",RELATED(SCD[Internal_Key]))
2. Using Merge option id query editor:
Create the custom column in both 2 tables using M code:
= Table.AddColumn(#"Changed Type1", "Custom", each Text.Combine({[Stichtag],"_",[Depot],"_",[WP ID]}))
And then Merge them using M code:
= Table.ExpandTableColumn(Source, "SCD", {"Stichtag", "Depot", "WP ID", "Custom"}, {"SCD.Stichtag", "SCD.Depot", "SCD.WP ID", "SCD.Custom"})
Regards,
Dina
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |