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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
mike_viz_lord
Frequent Visitor

Filtering Bottom N Specialties by State Not Working

Sample dashboard: Here 

 

My goal is to display Top 5 Specialties by Loss Ratio when a user selects a State on the map. Also, I want to display Bottom 5 Specialties by Loss Ratio (only where Loss Ratio > 0) when a user selects that State.

 

My data source was at the individual policy # level, but I've removed that column. Loss Ratio is calculated at the policy level as INCURRED / EARNED_PREMIUM.

 

I created a calculated column to get Loss Ratio using the following: 

DIVIDE(Sheet1[INCURRED],Sheet1[EARNED_PREMIUM]). I then display Loss Ratio as an avg by State by Specialty. However, when trying to display Bottom 5 (for only Loss Ratios > 0), I don't get the results expected.
 
I then created a calculated measure to get Loss Ratio using the following:
DIVIDE(SUM(Sheet1[INCURRED]), SUM(Sheet1[EARNED_PREMIUM])). I then display Loss Ratio by State by Specialty. However, my Loss Ratios by State by Specialty are different than what the calculated column produced and I still don't get the results expected for Bottom 5 (for only Loss Ratios > 0).

 

I assume this is related to a lack of using the CALCULATE and/or FILTER functions, which is why I posted in this forum. I'm not educated enough in this area yet and wanted to see if anyone could assist. 

 

Thanks in advance!

3 REPLIES 3
amitchandak
Super User
Super User

@mike_viz_lord ,

Any solution worked out for you?

Do the above replies help? if you need more help make me @

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@mike_viz_lord , Try like


Top 5 = CALCULATE([Loss Ratio]),TOPN(3,ALL ('Table'[Specialties]),[Loss Ratio],DESC),VALUES('Table'[Specialties]))

 

or

Specialties Rank = RANKX(all(Table[Specialties]),[Loss Ratio])
TOP Quantity = avergageX(filter(VALUES(Table[Specialties]),[Specialties Rank]=1),[Loss Ratio])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
wdx223_Daniel
Super User
Super User

@mike_viz_lord  this measure can get the same result

Loss Ratio Calc2 = AVERAGEX(Sheet1,DIVIDE(Sheet1[INCURRED], Sheet1[EARNED_PREMIUM]))

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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