Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am trying to understand the CALCUALTE function. I have a pretty good idea of why it is useful and even some cases of when to use it,
However I understand that you do not need to provide a filter arguement in the CALCULATE function:
So you can write something like
CALCULATE(X) where X is some expression.
Now to me CALCULATE is used to modify filter contexts on where an expression is evaluated, so if you wanted to look at sales of bikes in China you could well write something like
CALCULATE(SUM('Sales'[SaleAmount],'Sales'[Type] = "Bike", 'Sales'[Country] = "China")
But I am failing to see why calculate is useful without giving any filters.
Clearly I am missing something here.
Can anyone explain?
Solved! Go to Solution.
Hi @cliveb2016
Calculate without filter argument does a very important job
"It transforms existing row context into a filter context"
For example inside a calculated column, see this post
http://www.excelnaccess.com/context-transition-using-calculate/
And even in a MEASURE where for example ROW context is introduced by an ITERATOR
Thus the MEASURES below would normally give different results
Measure = SUMX ( Table, CALCULATE ( SUM ( Table1[Column] ) ) )
Measure = SUMX ( Table, SUM ( Table1[Column] ) )
Hi,
There are generally two triggers to use the FILTER() function:
Hi @cliveb2016
Calculate without filter argument does a very important job
"It transforms existing row context into a filter context"
For example inside a calculated column, see this post
http://www.excelnaccess.com/context-transition-using-calculate/
And even in a MEASURE where for example ROW context is introduced by an ITERATOR
Thus the MEASURES below would normally give different results
Measure = SUMX ( Table, CALCULATE ( SUM ( Table1[Column] ) ) )
Measure = SUMX ( Table, SUM ( Table1[Column] ) )
Thanks for the answer I understand now.
One follow up question:
If you add the filter arguments does that change the fact that calculate propagates the row context to filter context?
Thanks,
HI,
Even if you add the filter arguments.....it won't affect the transformation of RowContext to FilterContext
Hi Zubair excellent help.
Would you mind responding to my related (but new) question. Thanks.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
117 | |
101 | |
71 | |
61 |