Forum Discussion

Raji001's avatar
Raji001
New Member
2 years ago
Solved

alculated Measure with Variable and if condition

    Hi All @amitchandak  @Ritaf1983 @Ashish_Mathur  @Greg_Deckler  I'm trying to write a dax query with the following requirement. I wanted to calculated the no. of pages used for each machin...
  • ryan_mayu's avatar
    2 years ago

    Raji001 

    pls try this

     

    Column =
    VAR _last=maxx(FILTER('Table','Table'[MachineName]=EARLIER('Table'[MachineName])&&'Table'[DateReportRun]<EARLIER('Table'[DateReportRun])),'Table'[DateReportRun])
    return if(ISBLANK(_last),'Table'[PagesUsed],'Table'[PagesUsed]-maxx(FILTER('Table','Table'[DateReportRun]=_last&&'Table'[MachineName]=EARLIER('Table'[MachineName])),'Table'[PagesUsed]))