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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tjlundquist1
Helper I
Helper I

Running Total of % of Column Total

Need some help with a measure. I have created groups based on a date, and what I have been able to do is to see the % of values that fall in those groups. What I want to do is create a running total of those % of values. 

 

For example below, I want a column to display 44.42% for the 0-2 bucket and 65.40% for the 3-7 bucket and so on and so forth.

group1.jpg

I have created a measure, but it isn't accurate. It's not referencing the state or any of the other data in my query. The percentages are within a 10th or 100th of a percent - and that isn't possible. 

See below, Lines is the column that is accurate. Measure is the measure that I have created. The 0-2 bucket row should be the same for lines and measure and it isn't..

grou2.jpg

Here is the measure:

 

 

 

Measure = 
VAR _table =
    SUMMARIZE (
        Query1,
        Query1[Group Bucket],
        "a", CALCULATE ( MAX ( Query1[Index] ), ALLEXCEPT ( Query1, Query1[Group Bucket] ) )
    )
VAR _cumulative =
    CALCULATE ( MAX ( Query1[Index] ), _table )
VAR _total =
    CALCULATE ( MAX ( Query1[Index] ), ALL ( Query1 ) )
RETURN
    _cumulative / _total

 

 

 

Ultimately, I am going to create a graph that looks like the one in excel below - I be slicing by state and line of business.

2020-02-10_15-11-16.2.jpg

 

Any help would be really appreciated! I don't do running totals often, they are tricky.

Trevor

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

I did not get it. % of the total of Max measure?

refer

https://community.powerbi.com/t5/Desktop/cumulative-percentages/td-p/571128

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

I did not get it. % of the total of Max measure?

refer

https://community.powerbi.com/t5/Desktop/cumulative-percentages/td-p/571128

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you - I tried the cumulative measure. I have attached a sample pbix to show the result, and it's not what I am looking for.
The measure I created is called "Test Measure."

Test measure = 
var CountbyGroup=CALCULATE(COUNT('Sheet1 (2)'[Line #]),FILTER(ALLSELECTED('Sheet1 (2)'),ISONORAFTER('Sheet1 (2)'[Custom (groups)],MAX('Sheet1 (2)'[Custom (groups)]),DESC)))
var TotalCount=CALCULATE(COUNT('Sheet1 (2)'[Line #]),ALLSELECTED('Sheet1 (2)'))
return DIVIDE(CountbyGroup,TotalCount)

 

Link to pbix 

On page 2, the top chart should should start with the percentage of lines in the first group against the total number of lines. And each group following the previous group should show it's percentage plus the previous percentage. So you can see the bottom chart shows the number of lines in each group respectivly. 

0-2 should be something like 40% and 365 < should be 100%.

 

Thoughts? @amitchandak 

Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.