Forum Discussion

nadias's avatar
nadias
Regular Visitor
9 years ago
Solved

Last month data filter in DAX

Hello. I'm new to PowerBI and DAX. Here is my problem of the day.   I'm trying to find a way to filter out last caledar month's data from the rest of the data and I need it to work automatically wh...
  • fhill's avatar
    9 years ago

    I just posted this for another thread that was looking for something simular.  Hope it helps!  FOrrest

     

    Prior_Month = CALCULATE(SUM(Table2[Price]),     // Sum Price
      DATESBETWEEN(Table2[Salesdate],     // Based on Dates Between
      Date(YEAR(EDATE(today(),-1)),MONTH(EDATE(today(),-1)),1),     // Date having Year = Today -1 Month / Month = today -1 Month, and Day = 1
      EOMONTH(today(),-1)))      // End Of Month effective today() -1 month