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
xRTP
Helper V
Helper V

Counting top 80-100% in rank

Hello, currently doing a ranking for agents a scorecard to be exact and their score is on whole number not in percent. The thing is i want to count the agent that fall under 80-100%, 60-79%, and 0-59% and put it in a Card to show in my Executive Summary. My roll up score or their final score is in calculated column. Kindly see the photo below for reference. Thanks in advance!

 

xRTP_0-1676822072777.png

 

5 REPLIES 5
Padycosmos
Solution Sage
Solution Sage

Though not entirely relevant, this video might help you with the concept:

https://www.youtube.com/watch?v=3IHsIngGdjU

v-yangliu-msft
Community Support
Community Support

Hi  @xRTP ,

I created some data:

vyangliumsft_0-1677571110815.png

Here are the steps you can follow:

1. Enter data – create a table.

vyangliumsft_1-1677571110819.png

2. Create measure.

 

Rank =
RANKX(
    ALL('Table'),CALCULATE(SUM('Table'[Value])),,DESC,Dense)
Flag =
VAR _count =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Group] ), ALL ( 'Table' ) )
VAR _08 = _count * ( 1 - 0.8 ) // 3
VAR _06 = _count * ( 1 - 0.6 ) // 6.8
VAR _079 = _count * ( 1 - 0.79 ) //4
VAR _059 = _count * ( 1 - 0.59 ) //6.97
RETURN
    SWITCH (
        TRUE (),
        MAX ( 'Slicer_Table'[Slicer] ) = "80-100%"
            && [Rank] <= _08,
            "Count" & ":"
                & COUNTX ( FILTER ( ALL ( 'Table' ), 'Table'[Rank] <= _08 ), [Group] ) & "-"
                & CONCATENATEX ( FILTER ( ALL ( 'Table' ), 'Table'[Rank] <= _08 ), [Group], "," ),
        MAX ( 'Slicer_Table'[Slicer] ) = "60-79%"
            && [Rank] >= _079
            && [Rank] <= _06,
            "Count" & ":"
                & COUNTX (
                    FILTER ( ALL ( 'Table' ), 'Table'[Rank] >= _079 && 'Table'[Rank] <= _06 ),
                    [Group]
                ) & "-"
                & CONCATENATEX (
                    FILTER ( ALL ( 'Table' ), [Rank] >= _079 && [Rank] <= _06 ),
                    [Group],
                    ","
                ),
        MAX ( 'Slicer_Table'[Slicer] ) = "0-59%"
            && [Rank] >= _059,
            "Count" & ":"
                & COUNTX ( FILTER ( ALL ( 'Table' ), 'Table'[Rank] >= _059 ), [Group] ) & "-"
                & CONCATENATEX ( FILTER ( ALL ( 'Table' ), 'Table'[Rank] >= _059 ), [Group], "," )
    )

 

3. Result:

vyangliumsft_0-1677571253506.pngvyangliumsft_1-1677571258366.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hello, this is awesome.

Im trying to add a new filter on the measure but i only get error, I have a calculated column named "Met/Not Met" and flag agents there if their score has met or not, so before the ranking i should filter agents who was flagged as "Met". Is it possible?

vanessafvg
Super User
Super User

please provide the sample data.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Whats your email? I'll email it to you. Thanks!

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.