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 I have included. And currently I am struggling to find a way to calculate the difference in total revenue between one period and the period before it (i.e., period-on-period change) in Power BI. Could somebody please help me with that? I have included the desired result at the bottom of this post.

 

PeriodWeekRevenue
Period 1Week 110
Period 1Week 124
Period 1Week 267
Period 1Week 234
Period 1Week 378
Period 2Week 434
Period 2Week 454
Period 2Week 423
Period 2Week 567
Period 2Week 634
Period 2Week 654
Period 3Week 745
Period 3Week 778
Period 3Week 890
Period 3Week 8123
Period 3Week 812
Period 3Week 834
Period 3Week 95

 

Desired Result:

PeriodTotal RevenueRevenue Difference
Period 1213 
Period 226653
Period 3387121

 

So, I would like to see the difference in total revenue between one period and the period before it (Revenue Differnce column). For example, Period 3 - Period 2, Period 2 - Period 1 and so on. It is a similar concept to a month-on-month calculatinon. Any help would be appreciated. Thanks:)

2 Replies

  • Hi, Alex35749 
    First, group by Period in Power Query which will give you this-

     

    Add a column PeriodNumber -

     

     

    Next step will be to create a measure to calculate difference with previous revenue-

     

    It will give the desired output-

    Hope this helps 🙂