cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
parslei
New Member

Running total from max to min

Hi, I'm posting this in vein hope.

I have a count of population by Practice and I want to create a running total from the practice with the highest population, to the second highest and third etc etc... However, when I try and use the quick measure to build something it only allows me to build on the practice name so it builds a running total in alphabetical order of practice names. I'm at a loss what to do. Any help would be much appreciated 

parslei_0-1634368530176.png

LD Population running total =
CALCULATE(
    [LD Population],
    FILTER(
        ALLSELECTED(LD[Practice name]),
        ISONORAFTER(LD[Practice name], MAX(LD[Practice name]), DESC)
    )
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

LD Population running total : =
VAR currentpopulation = [LD Population measure :]
RETURN
CALCULATE (
[LD Population measure :],
FILTER (
ALL ( LD[Practice name] ),
[LD Population measure :] >= currentpopulation
)
)

 

 


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

2 REPLIES 2
parslei
New Member

@Jihwan_Kim thank you so so much this was exactly what I wanted and works as I wanted!!! Brilliant 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture1.png

 

LD Population running total : =
VAR currentpopulation = [LD Population measure :]
RETURN
CALCULATE (
[LD Population measure :],
FILTER (
ALL ( LD[Practice name] ),
[LD Population measure :] >= currentpopulation
)
)

 

 


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.