Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone
I want to convert this code from sql to Dax
(SELECT T1.DIMENSIONATTRIBUTE, T1.ENTITYINSTANCE, T1.PARTITION
, T2.DISPLAYVALUE, T3.DIMENSIONATTRIBUTEVALUECOMBINATION AS VALUECOMBINATIONRECID
FROM DIMENSIONATTRIBUTEVALUE AS T1 INNER JOIN
DIMENSIONATTRIBUTELEVELVALUE AS T2 ON T1.RECID = T2.DIMENSIONATTRIBUTEVALUE AND T1.PARTITION = T2.PARTITION INNER JOIN
DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION AS T3 ON T2.DIMENSIONATTRIBUTEVALUEGROUP = T3.DIMENSIONATTRIBUTEVALUEGROUP AND T2.PARTITION = T3.PARTITION
GROUP BY T1.DIMENSIONATTRIBUTE, T1.ENTITYINSTANCE, T1.PARTITION, T2.DISPLAYVALUE, T3.DIMENSIONATTRIBUTEVALUECOMBINATION
Solved! Go to Solution.
Hi @Wadda7AboUdai ,
First use NATURALINNERJOIN or FILTER and RELATED to create a new table that represents the join between T1 and T2.
Step1_Result =
NATURALINNERJOIN(
DIMENSIONATTRIBUTEVALUE,
DIMENSIONATTRIBUTELEVELVALUE
)
Then join the result with the third table T3.
Final_Result =
NATURALINNERJOIN(
Step1_Result,
DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION
)
Finally, use SELECTCOLUMNS to select the desired columns from the result of Step 2.
Merged_Table =
SELECTCOLUMNS(
Final_Result,
"DIMENSIONATTRIBUTE", DIMENSIONATTRIBUTEVALUE[DIMENSIONATTRIBUTE],
"ENTITYINSTANCE", DIMENSIONATTRIBUTEVALUE[ENTITYINSTANCE],
"PARTITION", DIMENSIONATTRIBUTEVALUE[PARTITION],
"DISPLAYVALUE", DIMENSIONATTRIBUTELEVELVALUE[DISPLAYVALUE],
"VALUECOMBINATIONRECID", DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION[DIMENSIONATTRIBUTEVALUECOMBINATION]
)
But please note that this is just directly written by me based on the SQL you provided, if it's not correct, please also provide me with sample data from your three data tables, thank you!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Wadda7AboUdai ,
First use NATURALINNERJOIN or FILTER and RELATED to create a new table that represents the join between T1 and T2.
Step1_Result =
NATURALINNERJOIN(
DIMENSIONATTRIBUTEVALUE,
DIMENSIONATTRIBUTELEVELVALUE
)
Then join the result with the third table T3.
Final_Result =
NATURALINNERJOIN(
Step1_Result,
DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION
)
Finally, use SELECTCOLUMNS to select the desired columns from the result of Step 2.
Merged_Table =
SELECTCOLUMNS(
Final_Result,
"DIMENSIONATTRIBUTE", DIMENSIONATTRIBUTEVALUE[DIMENSIONATTRIBUTE],
"ENTITYINSTANCE", DIMENSIONATTRIBUTEVALUE[ENTITYINSTANCE],
"PARTITION", DIMENSIONATTRIBUTEVALUE[PARTITION],
"DISPLAYVALUE", DIMENSIONATTRIBUTELEVELVALUE[DISPLAYVALUE],
"VALUECOMBINATIONRECID", DIMENSIONATTRIBUTEVALUEGROUPCOMBINATION[DIMENSIONATTRIBUTEVALUECOMBINATION]
)
But please note that this is just directly written by me based on the SQL you provided, if it's not correct, please also provide me with sample data from your three data tables, thank you!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
4 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |