Forum Discussion
J_Eastwood
2 months agoFrequent Visitor
Matrix period showing incorrect total when using previous year measure
I have a dataset that shows items with a received date and I have set up a separate calendar table matching the date in the calendar table, to the received date in the dataset. The calendar also has ...
- 2 months ago
Hi J_Eastwood,
You can try the following measure instead of using [Prev Year Count] directly in the matrix –
Prev Year Count Display = IF( ISINSCOPE('Calendar'[Fiscal Quarter]), [Prev Year Count], SUMX( SUMMARIZE( 'Calendar', 'Calendar'[Fiscal Year], 'Calendar'[Fiscal Quarter] ), CALCULATE([Prev Year Count]) ) )- At the Fiscal Quarter level, it returns the original [Prev Year Count] value.
- At the Fiscal Year total level, Power BI normally recalculates the measure for the entire year, which can produce unexpected totals when using DISTINCTCOUNT.
- This measure overrides that behavior by summing the quarter-level previous year values, making the Fiscal Year total align with the visible quarter rows.
Use [Prev Year Count Display] in the matrix instead of [Prev Year Count] and check whether the Fiscal Year totals now match your expected results.
💡 Helpful? Give a Kudos 👍 — keep the community growing
✅ Solved your issue? Mark as Solution ✔️ — help others find it faster
Best regards,
Rupasree Achari | BI & Fabric Analytics Engineer
parry2k
Super User
2 months agoJ_Eastwood I would recommend using the time intelligence function by creating a new fiscal calendar instead of re-inventing the wheel. Implement time-based calculations in Power BI - Power BI | Microsoft Learn
J_Eastwood
2 months agoFrequent Visitor
thank you, I will look into this, but have used the accepted solution measure in the meantime