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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vmonkey
Helper I
Helper I

Running Total or Cummulative Percentage on Count in Grouped Bins

I am new to PowerBi and have spent a considerable amount of time struggling with this problem.  I am hoping that someone here can tell me if what I am attempting is even possible.

 

I have the following table which I requirement to use various sliders on (it currently has two slicers to make it smaller for the question).

 

Capture.PNG

 

Is it possible to create a Measure that will provide a running total of the [Count of Volume] field, in the order from greatest to least, or in the order of the [clc_Rank] measure as seen above?  My end goal is to have a cummulative percentage, but I can't get past this one step.  

 

The code that I am currently working with for the [clc_RunningTotal] measure is as follows:

 

clc_RunningTotal = 
CALCULATE(
	COUNTA('vmFNC_DATA_DAILY_RTH()'[Volume]),
	FILTER(
		ALLSELECTED('vmFNC_DATA_DAILY_RTH()'[Volume (bins)]),
		ISONORAFTER('vmFNC_DATA_DAILY_RTH()'[Volume (bins)], MAX('vmFNC_DATA_DAILY_RTH()'[Volume (bins)]), DESC)
	)
)

The code gives a running total, but orders it according to the [Volume (bins] field.  PowerBi won't accept my [clc_Rank] measure to order the table.

 

Capture.PNG

 

Is there a way to do this?

 

thank you,

 

 

1 ACCEPTED SOLUTION

Hi @vmonkey

 

This will do it

 

clc_RunningTotal_NEW3 =
VAR CurrentCount =
    SUM ( 'vmFNC_DATA_DAILY_RTH()'[clc_COL_VolumeCount] )
RETURN
    SUMX (
        FILTER (
            ALL ( 'vmFNC_DATA_DAILY_RTH()'[Volume (bins)] ),
            CALCULATE ( SUM ( 'vmFNC_DATA_DAILY_RTH()'[clc_COL_VolumeCount] ) )
                >= CurrentCount
        ),
        CALCULATE ( SUM ( 'vmFNC_DATA_DAILY_RTH()'[clc_COL_VolumeCount] ) )
    )

Regards
Zubair

Please try my custom visuals

View solution in original post

11 REPLIES 11

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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