Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Count IF statement Annualization

I have a measure that creates a cumulative running total for revenue. 

Cumulative Total= 

CALCULATE (
    SUM ( 'Sales Table'[Revenue] ),
    FILTER (
        ALL ( 'DIM_DATE' ),
        'DIM_DATE'[DATE_ACTUAL] <= MAX( ( 'DIM_DATE'[DATE_ACTUAL] )
    )
))
 
I have another measure that uses an IF statement to see if a customer is new or not. 
If Measure =
VAR CumulTot= [Cumulative Total MEASURE]
VAR preCumulTot= [CumlTotalPreviousMonth]
VAR Result= IF(CumulTot<>0 && preCumulTot=BLANK(), 1,0)

RETURN
Result
 
I have a measure that correctly takes the sum if viewed in "Month Year" format, but if I view in Qtr or Yr format, the counts are off.
I assume the counts are off based on the IF statement , but I am unsure how to go abt it to get accurate counts in each Date Hiearchy view?
 
The calc to sum the If Measure is 
If Measure Sum= SUMX(CALCULATETABLE(VALUES(Customer Table[Customer Name]),ALL(DIM_DATE[Month Year],DIM_DATE[YEAR_MONTH_NUM]),DIM_DATE[Year Month order]), [If Measure])

2 Replies