Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Strange behavior measures last month for only two values

Hi everyone I have a problem with this formula:   01_C_LAST_MONTHS_A+B = var current_month= MONTH(TODAY()) return CALCULATE(SUM('01_DB_GLOBALE'[SaldoC]), FILTER('01_DB_GLOBALE', '01_DB_GLOBALE'[TIP...
  • amitchandak's avatar
    5 years ago

    Anonymous , not very clear. The image is missing. Or did not load for me

     

    Use time intelligence with help from date table

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
    last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
    last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

     

    Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))

    2 Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-2,Month))