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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.