Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The 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.

Reply
Anonymous
Not applicable

Why use the CALCULATE function on Power BI measures?

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  🙂 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

please refer to 

Power BI Tips - DAX Calculate Function (databear.com)

vxiaotang_0-1666605877851.png

 

Context Transition and Filters in CALCULATE - SQLBI

vxiaotang_1-1666605907611.png

 

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.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

please refer to 

Power BI Tips - DAX Calculate Function (databear.com)

vxiaotang_0-1666605877851.png

 

Context Transition and Filters in CALCULATE - SQLBI

vxiaotang_1-1666605907611.png

 

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.

amitchandak
Super User
Super User

@Anonymous , calculate is needed when you want to add filters.

example

calculate(Sum(Table[Value]), item[Brand] ="ABC")

 

refer

https://community.powerbi.com/t5/Community-Blog/The-CALCULATE-Function-In-Power-BI-DAX-Tutorial/ba-p/1944173

https://www.phdata.io/blog/the-calculate-function-in-power-bi/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors