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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mera9
Regular Visitor

Show quartile based on rank.

I am trying to create a measure that shows a quartile based on the rank of the vendor. 
5226760915179921507.jpg

Currently, there are around 680 Vendors and it will be dynamic.
There should be 4 quartiles - Top 25%, Top 50%, Bottom 50%, Bottom 25%.
Here is the formula that I have now but it doesn't work correctly and I don't know how to improve it:

Vendor Quartile =
VAR TotalVendors = COUNTROWS(vDIM_Vendor_Daily)
VAR QuartileSize = ROUNDUP(TotalVendors / 4, 0)
RETURN
SWITCH(
TRUE(),
[OTIF Rank] <= QuartileSize, "Top 25%",
[OTIF Rank] <= 2 * QuartileSize, "Top 50%",
[OTIF Rank] <= 3 * QuartileSize, "Bottom 50%",
"Bottom 25%"
)


Please help!

1 ACCEPTED SOLUTION
adudani
Super User
Super User

hi @Mera9 ,

 

maybe try using this, if it fits your use case: Calculate Percentile in Power BI (youtube.com)

else another dax function that may come in handy: PERCENTILE.INC function (DAX) - DAX | Microsoft Learn
usage shown here : PERCENTILE.EXC, PERCENTILE.INC, PERCENTILEX.EXC, PERCENTILEX.INC - DAX Guide (youtube.com)

 

if this doesn't resolve the issue, kindly provide sample input and output data masking sensitive information and in a usable format ( table, excel etc.)

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

1 REPLY 1
adudani
Super User
Super User

hi @Mera9 ,

 

maybe try using this, if it fits your use case: Calculate Percentile in Power BI (youtube.com)

else another dax function that may come in handy: PERCENTILE.INC function (DAX) - DAX | Microsoft Learn
usage shown here : PERCENTILE.EXC, PERCENTILE.INC, PERCENTILEX.EXC, PERCENTILEX.INC - DAX Guide (youtube.com)

 

if this doesn't resolve the issue, kindly provide sample input and output data masking sensitive information and in a usable format ( table, excel etc.)

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.