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
Talal141218
Helper III
Helper III

Dynamic Cumulative or Total Ranning

Hi Profis, 

I have question regarding to cumulative measure. I create i cumulative measure as below : 

RT = CALCULATE([CM_Stock_Amount_ExclRes_piec], FILTER(ALLSELECTED(Dim_Item[ItemNo]), Dim_Item[ItemNo] <=max(Dim_Item[ItemNo]))). In Addition when i sort the items rely on the amounts the Formula will not works anymore  , please look at the Pics: 
Before                                                                                                 
Talal141218_2-1695821774315.png

After sorting depend on Quantity : 

Talal141218_3-1695822061470.png

Note : Earlier measure dos't work with my Power BI

Thanks in Advance 🙂 


 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Talal141218 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1696561496259.png

2. create a measure with below dax formula

cumulative =
VAR cur_quantity =
    SELECTEDVALUE ( 'Table'[Quantity] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Quantity] >= cur_quantity )
RETURN
    SUMX ( tmp, [Quantity] )

3. add a table visual with table fields and mesure

vbinbinyumsft_1-1696561585906.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Talal141218 ,

It's normal, there's nothing wrong with it.

For your measure calculation logic, it does a cumulative sum based on your "Item Number" field, when you sort the "Quantity" field in the table visual, it doesn't change the logic of the calculation.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your answer. could you please share with me the formula, which I can  sort the cumulative amount. 

Anonymous
Not applicable

Hi @Talal141218 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1696561496259.png

2. create a measure with below dax formula

cumulative =
VAR cur_quantity =
    SELECTEDVALUE ( 'Table'[Quantity] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Quantity] >= cur_quantity )
RETURN
    SUMX ( tmp, [Quantity] )

3. add a table visual with table fields and mesure

vbinbinyumsft_1-1696561585906.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Talal141218
Helper III
Helper III

Is there any Expert can help me in this issue 🙂

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.