Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Flag Current QTR

Hello, I have to add a column QTR_FLAG in the table. Our FY starts in April. So, in a table(below) max YrMo will always be a previous month not a current Month. - If max year YrMo is 201809, then ...
  • LivioLanzo's avatar
    7 years ago

    Should be something like this if i understand correctrly:

     

    VAR RefDate = TODAY()
    VAR YrMoReference  = YEAR( EOMONTH( RefDate, -1 ) ) * 100 + MONTH( EOMONTH( RefDate, -1 ) )
    VAR QtrReference = CALCULATE( MIN( Dates[qtr] ), ALL( Dates ), Dates[YrMo] = YrMoReference )
    VAR FYReference = CALCULATE( MIN( Dates[fy] ), ALL( Dates ), Dates[YrMo] = YrMoReference )
    RETURN
    IF( Dates[FY] = FYReference && Dates[QTR] = QtrReference, 1, 0 )