Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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  🙂 

2 Replies