Forum Discussion
Calculating Quarter over Quarter Change
- 1 year ago
Hi ssrinath ,
Really solid breakdown — and you're absolutely right: built-in functions like PREVIOUSQUARTER() aren't designed for partial period comparisons, especially when you're working at the day level within a quarter.
Here’s a pattern that might help:
Step-by-step approach:
- Create a calculated column in your Date table to shift each date back by 3 months:
PreviousQuarterDate = EDATE('Date'[Date], -3)- Create a measure to get the Volume for the shifted date:
Volume_PrevQ = CALCULATE( [Volume], FILTER( ALL('Date'), 'Date'[Date] = EDATE(SELECTEDVALUE('Date'[Date]), -3) ) )This will give you a day-to-day aligned comparison between the current quarter and the same relative day in the previous quarter.
- Handle quarter-end edge cases\ For the special case where the current date is the last day of the quarter, and the previous quarter had fewer days (e.g., June 30 vs. March 31), you can add logic like:
IsQuarterEnd = 'Date'[Date] = CALCULATE(MAX('Date'[Date]), ALLEXCEPT('Date', 'Date'[Quarter], 'Date'[Year])) AdjustedVolume_PrevQ = IF( [IsQuarterEnd], CALCULATE( [Volume], DATESINPERIOD( 'Date'[Date], EDATE(SELECTEDVALUE('Date'[Date]), -3), -1, DAY ) ), [Volume_PrevQ] )This way, you can aggregate the last few days of the previous quarter only when the current date is the true quarter-end.
Let me know if you want help adapting this to your model — especially if you're using a custom calendar or fiscal quarters.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Translation and text formatting supported by AI assistance
Hi ssrinath
Since you accepted the solution, I'm glad your issue has been resolved. If you have any further questions or encounter other issues, please don't hesitate to start a new thread in the community.
Thank you for reaching out to the Microsoft Fabric Forum Community.