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
Ashish_Mathur
Super User
2 months agoHi,
Does this measure work?
Prev Year Count = CALCULATE([CSINs Count],sameperiodlastyear('Calendar'[Dates]))J_Eastwood
2 months agoFrequent Visitor
thanks for the response, this gives the same quarter subtotal as my version. I have used the accepted solution instead