Reply
Cevola
Helper I
Helper I

How to calculate 5th Percentile

Hi All,

 

I have the following data and I want to write a measure to calculate 5th percentile of "Value" columns. 

Note: I want all the ID's with values falling in the 5th percentile.

 

IdValue%GT Value
A12.9938579622.88%
A24.7909807894.61%
A35.2854234745.08%
A49.8459462149.47%
A513.161947212.65%
A63.0617127192.94%
A714.1085351513.56%
A820.4045530519.62%
A98.0820059917.77%
A100.9279738510.89%
A119.3577742689.00%
A1212.0030951411.54%

 

Thanks for your help.

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Cevola 

According to your description, you want to "calculate 5th percentile and show all the ID's with values falling in the 5th percentile".

We can create a measure to get the 5th percentile :

5th Percentile = 
var _t = SUMMARIZE( ALLSELECTED('Table') , 'Table'[Id] , "value" , CALCULATE( SUM('Table'[Value])))
return
 PERCENTILEX.INC(_t , [value] , 0.5)

vyueyunzhmsft_0-1689731592047.png

If you want to show all IDS which is less then the 5th percentile , we can create another measure:

Measure = IF( MAX('Table'[Value]) <= [5th Percentile] ,1, -1)

Then we can put this measure on the "Filter on this visual":

vyueyunzhmsft_1-1689731690940.png

 

If I misunderstood what you mean, you can tell me your detailed calculation process and logic, and provide me with your final desired result in the form of a table, so that we can help you better!

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Cevola 

According to your description, you want to "calculate 5th percentile and show all the ID's with values falling in the 5th percentile".

We can create a measure to get the 5th percentile :

5th Percentile = 
var _t = SUMMARIZE( ALLSELECTED('Table') , 'Table'[Id] , "value" , CALCULATE( SUM('Table'[Value])))
return
 PERCENTILEX.INC(_t , [value] , 0.5)

vyueyunzhmsft_0-1689731592047.png

If you want to show all IDS which is less then the 5th percentile , we can create another measure:

Measure = IF( MAX('Table'[Value]) <= [5th Percentile] ,1, -1)

Then we can put this measure on the "Filter on this visual":

vyueyunzhmsft_1-1689731690940.png

 

If I misunderstood what you mean, you can tell me your detailed calculation process and logic, and provide me with your final desired result in the form of a table, so that we can help you better!

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)