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.
Hi,
I'm looking for the following join of tables based on multiple keys, preferrably in DAX (not power query):
So based on GROUP & TYPE for each LINE, PRODUCT is joined.
Solved! Go to Solution.
Hi @wlknsnBI
If you are looking to output a table then Power Query would be more efficient.
If you are looking to create a relationship between these two tables then you can concatenate these two columns and later create a relationship.
If you just need it for a Measure you can use TREATS
if you need to calculate a table then you can use this code.
Table =
GENERATE(
Table1,
VAR __group = Table1[Group]
VAR __type = Table1[Type]
RETURN
SELECTCOLUMNS(
FILTER(
Table2,
Table2[Group] = __group
&& Table2[Type] = __type
),
"Line", Table2[Line]
)
)
Hi @wlknsnBI
If you are looking to output a table then Power Query would be more efficient.
If you are looking to create a relationship between these two tables then you can concatenate these two columns and later create a relationship.
If you just need it for a Measure you can use TREATS
if you need to calculate a table then you can use this code.
Table =
GENERATE(
Table1,
VAR __group = Table1[Group]
VAR __type = Table1[Type]
RETURN
SELECTCOLUMNS(
FILTER(
Table2,
Table2[Group] = __group
&& Table2[Type] = __type
),
"Line", Table2[Line]
)
)
Try if this can help
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
In Dax you have to use crossjoin
new Tbl =
filter(crossjoin(selectcolumn(table1,"Grp1",Table1[group],"Prd1",Table1[Product],"Type1",Table1[Product],"Price1",Table1[Price]),table2),
[Grp1]=Table2[Group] && [Type1] = Table2[Type])
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |