Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
nivek29
Regular Visitor

How to calculate rolling difference grouped by other column values?

Hi together,

I have the following data where each Date stores a number of Orders per single FiscalYearQuarter (simplified). Each FiscalYearQuarter is stored within each Date, because we want to track if there are subsequent modifications taking place in the data.

 

FiscalYearQuarterOrdersDate
Q4-2021102023/01/30
Q3-202182023/01/30
Q2-2021122023/01/30
Q1-2021142023/01/30
Q4-202172023/01/29
Q3-202142023/01/29
Q2-202192023/01/29
Q1-202152023/01/29
Q4-202162023/01/28
Q3-202132023/01/28
Q2-2021122023/01/28
Q1-2021152023/01/28


My goal is to calculate the rolling difference of the sum of Orders between the current and previous Date within a single FiscalYearQuarter. E.g., I need to calculate how the sum of Orders belonging to FiscalYearQuarter Q2-2021 has changed over the course of Date (as indicated in purple).

My previous attempts were not successful:

 

 

Delta =

VAR PreviousDate = Data[Date] - 1

RETURN Data[Orders] - SUMX(FILTER(Data, Data[Date] = PreviousDate, Data[Orders])

 


I hope this is a starting point. What's needs to be added is that I need the rolling difference (delta) between each two Dates and not only as a total measure, so that I can illustrate it as a line diagram with Date as x-axis in oder to track delta over time. Therefore, a calculated column might be necessary. Thanks in advance!

1 REPLY 1
nivek29
Regular Visitor

Note: I also experimented with trying to group by the Fiscal Year Quarters, but so far I do not get any meaningful resulting values

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.