Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Monthly variance

Hi everyone    Need help... I am new to DAX and trying to calculate the monthly variance for a graph. Would like to be able to do this calculation in PBI itself. Currently it's being done on excel ...
  • ryan_mayu's avatar
    4 years ago

    Anonymous 

    you can create a date column and create a variance column.

    date = date(left('Table'[Year month],4),RIGHT('Table'[Year month],2),1)
    
    Column = 
    VAR _last=maxx(FILTER('Table','Table'[platfrom]=EARLIER('Table'[platfrom])&&'Table'[date]=EDATE(EARLIER('Table'[date]),-1)),'Table'[coverage])
    return if(ISBLANK(_last),BLANK(),('Table'[coverage]-_last))

    pls see the attachment below