Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
When I create measures on Power BI, I usually just go straight to the function I want to create. And that usually works.
However, I often see other people using the CALCULATE function before the actual functions. I wonder why is that?
EXAMPLE:
If I need to sum the numbers within a table, I might just create a new measure like this:
TotalSales = SUM('table'[column])
However, I often see people doing this, to achieve the same result:
TotalSales = CALCULATE(SUM('table'[column]))
So, what is exactly the advantage in putting CALCULATE in front of the measures, even when there doesn't seem to be an obvious need to it?
Thanks 🙂
Solved! Go to Solution.
Hi @Anonymous
Thanks for reaching out to us.
please refer to
Power BI Tips - DAX Calculate Function (databear.com)
Context Transition and Filters in CALCULATE - SQLBI
CALCULATE function (DAX) - DAX | Microsoft Learn
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Thanks for reaching out to us.
please refer to
Power BI Tips - DAX Calculate Function (databear.com)
Context Transition and Filters in CALCULATE - SQLBI
CALCULATE function (DAX) - DAX | Microsoft Learn
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , calculate is needed when you want to add filters.
example
calculate(Sum(Table[Value]), item[Brand] ="ABC")
refer
https://www.phdata.io/blog/the-calculate-function-in-power-bi/
User | Count |
---|---|
129 | |
72 | |
70 | |
58 | |
53 |
User | Count |
---|---|
190 | |
97 | |
67 | |
63 | |
54 |