Forum Discussion

Malsk1_1's avatar
Malsk1_1
Icon for Helper II rankHelper II
4 years ago
Solved

Previous available month data comparison

Hi,   In my basic model, i have a MoM table, which is linked via the baseline to the Connected Date table. See link Previous available month data    The importance of this issue is that there is...
  • Fowmy's avatar
    4 years ago

    Malsk1_1 

    Create the following measure. I attached the file.

    Previous Month Cost = 
    VAR LastCostDate = MAX(MoM[baseline])
    VAR LastData = CALCULATE( EOMONTH( MAX(MoM[baseline]) , 0 )  , Dates[Date] < LastCostDate )
    VAR DateFilter = DATESINPERIOD(Dates[Date],LastData, -1 , MONTH ) 
    RETURN
    IF( HASONEVALUE(Dates[Year Month]),  CALCULATE( [Month Cost],   DateFilter  ) )