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
Solariz9
Regular Visitor

cumulative measure yields incorrect values when slicer applied (data source and pbi attached)

I have a meansure to caculate cumulative count of records based on the column "DeltaMonth" as below

 

K_TOTAL = 
VAR MX = MAX(Data[DeltaMonth])
RETURN CALCULATE(
	DISTINCTCOUNT(Data[Number]),
	FILTER(
		ALL(Data[DeltaMonth]),
		Data[DeltaMonth] <= MX
	)
)

 

It works quite well, yielding cumulative figures

Solariz9_0-1722391417734.png

 

 

But when I apply the slicer to both "Severity" & "Edition", the cumulative measure doesn't work properly anymore:

 

 

Solariz9_1-1722391431187.png

 

Solariz9_2-1722391444629.png

 

 

Can anyone help to figure this out? The data source can be found in the attached xlsx table.

 The : PBI file 

 The data source

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Solariz9 ,

You can update the formula of measure [K_TOTAL] as below:

K_TOTAL = 
VAR MX =
    SELECTEDVALUE ( Data[DeltaMonth] )
VAR _edition =
    SELECTEDVALUE ( 'Data'[Edition] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( Data[Number] ),
        FILTER (
            ALLSELECTED ( Data ),
            'Data'[Edition] = _edition
                && Data[DeltaMonth] <= MX
        ),
        REMOVEFILTERS ( 'Data'[DeltaMonth] )
    )

vyiruanmsft_0-1722588982320.png

Best Regards

View solution in original post

6 REPLIES 6
rajendraongole1
Super User
Super User

Hi @Solariz9 - you can use the REMOVEFILTERS function instead of ALL to retain the other slicers, use the below measure

K_TOTAL =
VAR MX = MAX(Data[DeltaMonth])
RETURN
CALCULATE(
DISTINCTCOUNT(Data[Number]),
FILTER(
REMOVEFILTERS(Data[DeltaMonth]),
Data[DeltaMonth] <= MX
)
)

 

Hope it works

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1 ,

 

It seems the syntax is wrong if just replace ALL with REMOVEFILTERS. See this screen copy:

Solariz9_0-1722479647923.png

 

Anonymous
Not applicable

Hi @Solariz9 ,

I can't open your shared pbix file and got the file corrupted error. I created a sample pbix file(see the attachment) base on shared excel file. You can update the formula of measure [K_TOTAL] as below to get the expected result...

K_TOTAL = 
VAR MX =
    MAX ( Data[DeltaMonth] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( Data[Number] ),
        FILTER ( ALLSELECTED ( Data ), Data[DeltaMonth] <= MX ),
        REMOVEFILTERS ( 'Data'[DeltaMonth] )
    )

vyiruanmsft_1-1722502610104.png

Best Regards

Dear @Anonymous ,

 

Thanks so much for your solution. It's approaching to the final destination, but still not perfect.

 

If keep YYY2401 select, it's working pretty well. But if we select 2 Editions or more, you can see all of Editions are mixed together. As below screen copy. Now I have to doubt, there's something wrong in Power BI ...

 

Solariz9_0-1722578036040.png

 

I uploaded the compressed pbix file as this, please try if you can open it.

Anonymous
Not applicable

Hi @Solariz9 ,

You can update the formula of measure [K_TOTAL] as below:

K_TOTAL = 
VAR MX =
    SELECTEDVALUE ( Data[DeltaMonth] )
VAR _edition =
    SELECTEDVALUE ( 'Data'[Edition] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( Data[Number] ),
        FILTER (
            ALLSELECTED ( Data ),
            'Data'[Edition] = _edition
                && Data[DeltaMonth] <= MX
        ),
        REMOVEFILTERS ( 'Data'[DeltaMonth] )
    )

vyiruanmsft_0-1722588982320.png

Best Regards

hi @Anonymous 

 

Thank you so much! the issue is now perfectly solved.

 

Can you please explain more? why Edition has to be put as SELECTEDVALUE? Why there's no need to put Severity as SELECTEDVALUE? Thanks in advance!

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.