Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi all,
I have two (hopefully easy) general questions on best practices for newbies when using a CALCULATE function:
1. Is it better to use a column reference or a measure as a first argument? Just wondering, because you have to consider another layer of context transition when referencing a measure (and I'd like to keep things as simple as possible).
=CALCULATE([Measure1],...
=CALCULATE(sum('DATA'[Amount]),...
2. What, if any, is the difference between the following two expressions?
=CALCULATE(sum('DATA'[Amount]),...
=CALCULATE('DATA'[Sum of Amount],...
As always, many thanks!
JK
Solved! Go to Solution.
1. Those are equivalent, but it is best practice to re-use existing measures if possible.
2. The first is a valid expression while the second will give an error in a measure due to the naked column reference.
Pat
Hi Pat,
Thanks for the feedback; appreciate your help.
For #2, the function was calculating an amount. Maybe the [Sum of Amount] was an implicit measure? Not sure. Nevertheless, I did change my DAX formulas to match the first expression.
Best regards,
John K.
1. Those are equivalent, but it is best practice to re-use existing measures if possible.
2. The first is a valid expression while the second will give an error in a measure due to the naked column reference.
Pat
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
29 | |
18 | |
15 | |
7 | |
6 |