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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
osura_perera
New Member

Finding the bottom two numbers in a mesaure

Hi, 

I have a measure calculating an average score for few a criteria-based items. I want to find the two worst numbers and return the heading it belongs. There are four buckets and four items per bucket. It should keep the filter on the main bucket. 

for example bucket 1 worst two areas in performance are service catalogue and simplicity to log a ticket. 

 

osura_perera_0-1637604108927.png

The values and the measurement are coming from a single table. 

In the common table, 

 

| Bucket 1 a | Bucket 2 a |

| Bucket 1 a | Bucket 2 b |

| Bucket 1 a | Bucket 2 c |

| Bucket 1 a | Bucket 2 d |     

| Bucket 1 b | Bucket 2 a |

| Bucket 1 b | Bucket 2 b |

| Bucket 1 b | Bucket 2 c |

| Bucket 1 b | Bucket 2 d |

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @osura_perera ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a measure as below to get the rank value per bucket base on the average value

 

Rank = 
IF (
    ISINSCOPE ( 'Table'[Items] ),
    RANKX (
        CALCULATETABLE ( VALUES ( 'Table'[Items] ), ALLSELECTED ( 'Table'[Items] ) ),
        [Average value],
        ,
        ASC,
        DENSE
    )
)

 

2. Apply a visual-level filter with condition: Rank <=2

yingyinr_0-1637828276950.png

You can also refer the following blog to achieve it.

Filtering the Top 3 products for each category in Power BI

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @osura_perera ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a measure as below to get the rank value per bucket base on the average value

 

Rank = 
IF (
    ISINSCOPE ( 'Table'[Items] ),
    RANKX (
        CALCULATETABLE ( VALUES ( 'Table'[Items] ), ALLSELECTED ( 'Table'[Items] ) ),
        [Average value],
        ,
        ASC,
        DENSE
    )
)

 

2. Apply a visual-level filter with condition: Rank <=2

yingyinr_0-1637828276950.png

You can also refer the following blog to achieve it.

Filtering the Top 3 products for each category in Power BI

Best Regards

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors