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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Libin7963
Helper II
Helper II

Cumulative Total

Below Dax is used for calculating the request on hand at the beginning of the selected period. I would like to calculate the cumulative total (example :  Jan = 3, Feb = 2, March 4 then Jan = 3,  Feb = 5 and March =9)for selected period(by month) in a matrix table. Table 1 has an active relationship with Valid date and inactive relationship with Decision date. Any assistance appreciated.

 

On Hand Cumulative =
CALCULATE(
COUNTX(
FILTER(
Table1,
Table1[ValidDate] < MIN('DimDate'[Date]) &&
(ISBLANK(Table1[DecisionDate]) || Table1[DecisionDate] >= MIN('DimDate'[Date])) &&
Table1[Type] IN {
"01", "02", "03", "04", "05", "06", "07", "08",
"09", "10", "11", "12", "13", "14", "15", "16",
"17", "18"
}
),
Table1[REFVAL]
),
CROSSFILTER('DimDate'[Date], Table1[ValidDate], None)
)

1 ACCEPTED SOLUTION

Hi @Libin7963 ,

Once try this:

On Hand Cumulative Total :=
VAR CurrentDate = MAX('DimDate'[Date])
RETURN
SUMX(
    FILTER(
        ALL('DimDate'),
        'DimDate'[Date] <= CurrentDate
    ),
    VAR LoopDate = 'DimDate'[Date]
    RETURN
        CALCULATE(
            COUNTROWS(
                FILTER(
                    Table1,
                    Table1[ValidDate] < LoopDate &&
                    (
                        ISBLANK(Table1[DecisionDate]) ||
                        Table1[DecisionDate] >= LoopDate
                    ) &&
                    Table1[Type] IN {
                        "01", "02", ..., "18"
                    }
                )
            ),
            CROSSFILTER('DimDate'[Date], Table1[ValidDate], None)
        )
)

View solution in original post

23 REPLIES 23

No, that didn't work. My data is like this and it is the Case count cumulative is what I am not getting 

Libin7963_0-1746543724020.png

 

Hi @Libin7963 ,

Once try this:

On Hand Cumulative Total :=
VAR CurrentDate = MAX('DimDate'[Date])
RETURN
SUMX(
    FILTER(
        ALL('DimDate'),
        'DimDate'[Date] <= CurrentDate
    ),
    VAR LoopDate = 'DimDate'[Date]
    RETURN
        CALCULATE(
            COUNTROWS(
                FILTER(
                    Table1,
                    Table1[ValidDate] < LoopDate &&
                    (
                        ISBLANK(Table1[DecisionDate]) ||
                        Table1[DecisionDate] >= LoopDate
                    ) &&
                    Table1[Type] IN {
                        "01", "02", ..., "18"
                    }
                )
            ),
            CROSSFILTER('DimDate'[Date], Table1[ValidDate], None)
        )
)

Hi @Libin7963 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.