Forum Discussion

Rosh89's avatar
Rosh89
Icon for Helper I rankHelper I
3 years ago
Solved

DAX for calculating previous month values

Hi,   I have a table as shown below: Month Period Customer Bonus Previous bonus Jan-22 1 A 100   Feb-22 2 A 200 100 Mar-22 3 A 150 200 Jan-22 1 B 300   Feb-22...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Rosh89 ,

     

    You could add a date column like below:

    date = DATEVALUE("1-"&'Table'[Month])

    Then create a measure:

    Measure = CALCULATE(SUM('Table'[Bonus]),FILTER(ALLEXCEPT('Table','Table'[Customer]),'Table'[date]=EDATE(SELECTEDVALUE('Table'[date]),-1)))