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
ssrinath You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Thank you so much for this - will check them out.