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
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 accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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 accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.