Forum Discussion

Alex35749's avatar
Alex35749
Regular Visitor
2 years ago
Solved

Calculating a difference between two periods

Hello Everyone. A bit of a background: in my work we rarely use actual calendar months (thus cannot use time intelligence functions), but we use periods instead as demonstrated in the sample dataset ...
  • ryan_mayu's avatar
    2 years ago

    Alex35749 

     

    you can try to create a measure

     

    Measure =
    VAR _last=maxx(FILTER(all('Table'),'Table'[Period]<max('Table'[Period])),'Table'[Period])
    return if(_last="",BLANK(),sum('Table'[Revenue])-SUMX(FILTER(ALL('Table'),'Table'[Period]=_last),'Table'[Revenue]))
     
     
    pls see the attachment below