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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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

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

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
Super User
Super User

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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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