Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Problem with LY MTD Calculations

Hi All,   I am using the following formula to calcuate LY MTD LY MTD Inv Sales =  CALCULATE( [Total Inv Sales], DATESMTD( SAMEPERIODLASTYEAR(DimDate[Date]) ) )   Assuming today is 25th Mar 2020...
  • v-easonf-msft's avatar
    v-easonf-msft
    6 years ago

    Hi , Anonymous 

    Try measures as below:

     

    LY MTD Inv Sales = CALCULATE(SUM('Table'[Value]), FILTER(DATESMTD( SAMEPERIODLASTYEAR('Date'[Date]) ),MONTH([Date] )<MONTH(TODAY()) || (MONTH([Date] )=MONTH(TODAY())&&day([Date] )<=day(TODAY()))))

     

    Here is a demo.

    Pbix attached

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.