Forum Discussion
dsandip
3 years agoFrequent Visitor
CALCULATE function is not working
Hi, I using below DAX: Cureent Quarter Sales = CALCULATE([Sales Amount], FILTER(ALL('Calendar'), 'Calendar'[Current QTD] = 1) ) and want to calculate values for [Current QTD] = 1 only and f...
- 3 years ago
dsandip OK, it's incorrect but what is your definition of correct? Maybe this?
Current Quarter Sales = VAR __Current = MAX( 'Calendar'[Current QTD] ) VAR __Result = IF( __Current = 1, CALCULATE([Sales Amount], FILTER(ALL('Calendar'), 'Calendar'[Current QTD] = 1)), 0 ) RETURN __Result
ppm1
3 years agoSolution Sage
Please try adding KEEPFILTERS to your measure.
Current Quarter Sales =
CALCULATE (
[Sales Amount],
KEEPFILTERS ( 'Calendar'[Current QTD] = 1 )
)
Pat
- dsandip3 years agoFrequent Visitor
hi,
I think KEEPFILTERS() function only show related result, leaving every row value blank as expected, but I want the summation of JAN, Feb, March 2023 in one row, so it show like below:
Measure 3 =CALCULATE ([Sales Amount],KEEPFILTERS ( 'Calendar'[Current QTD] = 1 ))