Forum Discussion

J_Eastwood's avatar
J_Eastwood
Frequent Visitor
2 months ago
Solved

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 ...
  • Rupa01's avatar
    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