Thursday, May 29, 2025

Power BI: Calculate Yearly Running Total of Sales for Region(s) Using DAX

 A Running Total shows the cumulative sum of a measure over a period, helping you track how values build up step-by-step. It’s essential for understanding trends, monitoring progress, and spotting patterns in sales, expenses, or any time-based data. Running totals are widely used in dashboards and reports to give a continuous, easy-to-follow view of performance over time.


Below is the table where we will add a calculated column to compute the Yearly Running Total of Sales Amount by Region using DAX.


The following DAX code calculates the Yearly Running Total of Sales Amount, broken down by region

Sales Amount (RunningTotal) =

CALCULATE (

    SUM ( SalesData[SalesAmount] ),

    FILTER (

        SalesData,

        SalesData[Region] = EARLIER ( SalesData[Region] )

            && SalesData[Year] <= EARLIER ( SalesData[Year] )

    )

)

Result: You can now see the Yearly Running Total of Sales Amount for Region


No comments:

Post a Comment