Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
2NV_DB
Frequent Visitor

Cumulative Total from a Summarised Table

Hello All,

 

I have the followed the information provided in this thread to create a summary table with a cumulative total here: https://community.fabric.microsoft.com/t5/Desktop/Cumulative-Using-Summarized-Table/td-p/1355321

However my cumulative value will not result and I don't understand why. It should be the cumulative of the Incremental Sales column.

2024-06-05_13h41_12.png
I expect the cumulative to be 80764+208746 etc. The Incremental Sales is simply 2024-2023 month.

What am I doing wrong?
Thanks

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.

I suggest having a [month number] column as well.

 

Jihwan_Kim_1-1717560457369.png

 

Jihwan_Kim_0-1717560419195.png

 

 

WINDOW function (DAX) - DAX | Microsoft Learn

 

expected result table =
VAR _t =
    ADDCOLUMNS (
        SUMMARIZE (
            consolidated_sales_actual,
            fianacial_calendar[Month],
            fianacial_calendar[Month Number]
        ),
        "2023sales",
            CALCULATE (
                SUM ( consolidated_sales_actual[sales_net] ),
                fianacial_calendar[Year] = 2023
            ),
        "2024sales",
            CALCULATE (
                SUM ( consolidated_sales_actual[sales_net] ),
                fianacial_calendar[Year] = 2024
            )
    )
VAR _diff =
    ADDCOLUMNS ( _t, "diff", [2024sales] - [2023sales] )
VAR _cumulatediff =
    ADDCOLUMNS (
        _diff,
        "cumulatedifference",
            SUMX (
                WINDOW (
                    1,
                    ABS,
                    0,
                    REL,
                    _diff,
                    ORDERBY ( fianacial_calendar[Month Number], ASC )
                ),
                [diff]
            )
    )
RETURN
    _cumulatediff

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.

I suggest having a [month number] column as well.

 

Jihwan_Kim_1-1717560457369.png

 

Jihwan_Kim_0-1717560419195.png

 

 

WINDOW function (DAX) - DAX | Microsoft Learn

 

expected result table =
VAR _t =
    ADDCOLUMNS (
        SUMMARIZE (
            consolidated_sales_actual,
            fianacial_calendar[Month],
            fianacial_calendar[Month Number]
        ),
        "2023sales",
            CALCULATE (
                SUM ( consolidated_sales_actual[sales_net] ),
                fianacial_calendar[Year] = 2023
            ),
        "2024sales",
            CALCULATE (
                SUM ( consolidated_sales_actual[sales_net] ),
                fianacial_calendar[Year] = 2024
            )
    )
VAR _diff =
    ADDCOLUMNS ( _t, "diff", [2024sales] - [2023sales] )
VAR _cumulatediff =
    ADDCOLUMNS (
        _diff,
        "cumulatedifference",
            SUMX (
                WINDOW (
                    1,
                    ABS,
                    0,
                    REL,
                    _diff,
                    ORDERBY ( fianacial_calendar[Month Number], ASC )
                ),
                [diff]
            )
    )
RETURN
    _cumulatediff

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Wow thank you! Not sure how, but this this works well! I'm not familiar with the Window function.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.