Forum Discussion

hstgeorge's avatar
hstgeorge
Helper III
1 year ago
Solved

Help with a Dax Formula

I am trying to create a formula that will show the variance month over month of the values in my table: Month               Jan          Feb         Mar Expenses          1000         2500     ...
  • ryan_mayu's avatar
    1 year ago

    hstgeorge 

    Is the table your raw data format or the table visual?

    If it's your raw data,

    1. select the first column and unpivot other columns in PQ

    2. create a new column

    3. change the type to date

     

    4. use DAX to create a column

     

    Column =
    var _last=maxx(FILTER('Table','Table'[Month]=EARLIER('Table'[Month])&&'Table'[Custom]=EDATE(EARLIER('Table'[Custom]),-1)),'Table'[Value])
    return if (ISBLANK(_last),BLANK(),'Table'[Value]-_last)
     
    pls see the attachment below