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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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.

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])

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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