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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Cogidubnus_Rex
Frequent Visitor

Cumulative sums that can be filtered

I am in need for some expertise, please, having been going at this for several days without success.

 

Consider the below table (as an image for better visuals then as a table to easily recreate the table contents):

 

 
 

 

I haveI haveI NEED AS A MEASUREI haveI haveI haveI NEED AS A MEASURE 
Business unitValueCumulative valueRankLate?Timeliness countCumulative on-time %What I want (not as a column but as a measure as it needs to be dynamic and filterable)
A$         1,234$         1,2341Late00% 
A$             325$         1,5592Late00% 
A$         2,521$         4,0803Late00% 
A$             236$         4,3164Late00% 
B$             875$         5,1915Late00% 
B$       24,563$       29,7546Late00% 
B$         7,455$       37,2097Late00% 
B$             546$       37,7558On-time112.5%=SUM($F$3:F10)/COUNTA($D$3:D10)
B$                 3$       37,7589On-time122.2% 
C$               46$       37,80410On-time130.0% 
C$         5,346$       43,15011On-time136.4% 
D$               57$       43,20712On-time141.7% 
D$             264$       43,47113On-time146.2% 
D$         7,546$       51,01714On-time150.0% 
D$               45$       51,06215On-time153.3% 
D$               73$       51,13516On-time156.3% 
D$             846$       51,98117On-time158.8% 
D$             486$       52,46718On-time161.1% 
D$         8,465$       60,93219On-time163.2% 
E$         4,658$       65,59020On-time165.0% 
F$         3,894$       69,48421On-time166.7% 
F$             679$       70,16322On-time168.2% 
F$                 6$       70,16923On-time169.6% 

 

For 'Timeliness count', 0 means late, and 1 is on time
The cumulative columns are for illustrative purposes only, I don't want them as calculated columns as they won't show in tables properly when filtered.
My understanding is that these cumulative calculations need to be measures, because they need to be dynamic, as the user may filter by business unit (or one of several other variables not shown here), and the cumulative calculations need to filter according to whatever has been selected.
So, that is the first part, to recreate the calculations per the columns in black above, but as measures.
From there, we then need to add something like slicers or filters which enable the user to say, show me the invoices that will take me to, for example, 30% on-time timeliness.
In this case, the table would then show the top ten items only.
Equally, the user needs to be able to filter/ select for a cumulative value limit, e.g. $40,000.
In this case, a $40,000 limit selected would show the top ten items only.
If the cumulative value and cumulative on-time %s are created using measures, I guess we need a work-around as they can't just be dropped into a slicer, right?  If I'm wrong, great.  Otherwise, I'm stuck.

Please help!!
Thank you for reading and for any superstars able to help, thank you so much in advance.

@TomMartens, @v-juanli-msft

1 ACCEPTED SOLUTION

@Cogidubnus_Rex try these measures if I understood correctly

 

Cumm Value = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] <= MAX ( 'Table'[Rank] ) ) )

Cumm Rank = CALCULATE ( SUM ( 'Table'[Rank] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] <= MAX ( 'Table'[Rank] ) ) )

Cumm Timeless = CALCULATE ( SUM ( 'Table'[Timeliess] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] <= MAX ( 'Table'[Rank] ) ) )

% = DIVIDE ( [Cumm Timeless], [Cumm Rank] )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
Cogidubnus_Rex
Frequent Visitor

Unfortunately my image was deleted.  I'll try again!

 

Picture2.jpg

@Cogidubnus_Rex try these measures if I understood correctly

 

Cumm Value = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] <= MAX ( 'Table'[Rank] ) ) )

Cumm Rank = CALCULATE ( SUM ( 'Table'[Rank] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] <= MAX ( 'Table'[Rank] ) ) )

Cumm Timeless = CALCULATE ( SUM ( 'Table'[Timeliess] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Rank] <= MAX ( 'Table'[Rank] ) ) )

% = DIVIDE ( [Cumm Timeless], [Cumm Rank] )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks, @parry2k , great measures (and simple too).

 

The rank measure actually doesn't work, as it's summing the rank, which is a much higher number.  So, I added a column that Count  = "1", and swapped that into the beginning of the formula, as below, and now it always give a dynamic rank, regardless of any filters applied.

 

Cumm Rank = CALCULATE ( SUM ( 'Table'[Count] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[RANK] <= MAX ( 'Table'[RANK] ) ) )
 
The second part of the ask was around using these as slicers, but they work perfectly well in the filter pane, so I'm delighted.
 
One last things, however, is that the rank includes ties, at which point the cumulative calculations don't add rows (where the rank is tied).

I am not sure how to resolve this. Could you clarify, please? 🙂
 
Many thanks once again, fantastic answer.

HI @Cogidubnus_Rex ,

If you can please share some a pbix file with some dummy data and similar data structure, then we can further test and coding formula on it.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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