Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create a matrix in powerbi

Hello,    My data is at day level and I would like to create a table using DAX measures that retrieve the value (not the sum of the month) at the last day of the previous month and the month before...
  • Greg_Deckler's avatar
    3 years ago

    Anonymous So like this?

    Measure =
      VAR __LastMonthDate = EOMONTH(TODAY(),-1)
      VAR __Last2MonthDate = EOMONTH(TODAY(),-2)
      VAR __LastMonth = MAXX(FILTER('Table',[Date]=__LastMonthDate),[Value])
      VAR __Last2Month = MAXX(FILTER('Table',[Date]=__Last2MonthDate),[Value])
    RETURN
      __LastMonth - __Last2Month