Forum Discussion
CALCULATE with NATUALLEFTOUTERJOIN
I am struggling with following:
Table A:
Key, Name
A, John
B, Jane
C, Ruby
Table B:
Key, Age
A, 24
C, 30
I have following code:
EVALUATE
ADDCOLUMNS (
NATURALLEFTOUTERJOIN ( A, B ),
"Test", CALCULATE ( MAX ( A[Key] ) )
)
Result:
Key, Name, Age, Test
A, John, 24, A
B, Jane, null, null
C, Ruby, 30, C
And for me expected result would be:
Key, Name, Age, Test
A, John, 24, A
B, Jane, null, B
C, Ruby, 30, C
!!!Note!!! That formula for calculating column [Test] will be put in measure.
Hi Anonymous
Based on my test, the result returned is correct using your DAX above after renaming the B[Key] to B[KeyB].
Please check the version of Power BI Desktop on your side, and the try it again after updating to the latest version 2.68.5432.661.
Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EUinxAXz0fpOhsaGKxemIi0Bn2TwfMkHXGEzAb8vPKPlDA?e=am86JT
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-xicai
Community Support
Hi Anonymous
Based on my test, the result returned is correct using your DAX above after renaming the B[Key] to B[KeyB].
Please check the version of Power BI Desktop on your side, and the try it again after updating to the latest version 2.68.5432.661.
Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EUinxAXz0fpOhsaGKxemIi0Bn2TwfMkHXGEzAb8vPKPlDA?e=am86JT
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.