Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
can anyone explain why these two different aproaches are giving different results ( first givin correct result)
Approach 1 - using three measures:
LatestAgreement =
Solved! Go to Solution.
Hi @henkka ,
Believe the main reason is the way you have the second calculation using variables, variables are calculated in the scope of the context so depedning on how you make use of them the calcuations changes.
When you use the 3 different metric approach you are making use of the Calculate argument even if not called directly so the calculation changes.
The context transiction is very tricky.
Check this blog post https://radacad.com/caution-when-using-variables-in-dax-and-power-bi
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @henkka ,
Believe the main reason is the way you have the second calculation using variables, variables are calculated in the scope of the context so depedning on how you make use of them the calcuations changes.
When you use the 3 different metric approach you are making use of the Calculate argument even if not called directly so the calculation changes.
The context transiction is very tricky.
Check this blog post https://radacad.com/caution-when-using-variables-in-dax-and-power-bi
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi, @MFelix and thanks for pointing out the reason behind that behaviour :)! I needed this understanding as I'm trying to create something a bit more efficient way to do this calculation 🙂
So the issue with the scenario 1 is that the variable is calculated and stored before the filtering and thus the filter is working as it should but the values for the filter are incorrect. The blog you linked was great!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
127 | |
109 | |
93 | |
70 | |
66 |