Forum Discussion

enocperez's avatar
enocperez
Frequent Visitor
10 years ago

Calculates MTD with New Measure

I want to get a New Measure and I get an errros all the time what am I doing.

 

Sales MTD =CALCULATE( [Sales], PARALLELPERIOD('Item Sales'[Date Of Business], -1,MONTH))

 

5 Replies

  • MattAllington's avatar
    MattAllington
    Icon for Community Champion rankCommunity Champion

    Sales is a column. You have not told Power Pivot how to aggregate the column.  Also you should never refer to a column without specifying the table name. So replace [Sales] with    sum(TableName[Sales])

     

    replace TableName with the actual name of your table. 

    • enocperez's avatar
      enocperez
      Frequent Visitor

      Ok I have made the update and still I get an issues with the Calculation.  

       

       

       

      • Sean's avatar
        Sean
        Icon for Community Champion rankCommunity Champion

        enocperez

        Do you have a Date table?

         

        MTD = TOTALMTD([MeasureName], CalendarTable[Date])
        MTD2 = Calculate([MeasureName],DATESMTD(CalendarTable[Date]))

         

        You can also do YTD and QTD with these just change where it says MTD to either one...

         

        Let me know if they work for you.