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
Cevola
Helper I
Helper I

How to calculate percentile

Hi,

 

I need to create a percentile column based on the VALUE column. The percentile needs to be calculated only for some IDs like A1, A3, A7, A8 etc. The data i have is:

IdValuePercentile
A12.993857962 
A24.790980789 
A35.285423474 
A49.845946214 
A513.1619472 
A63.061712719 
A714.10853515 
A820.40455305 
A98.082005991 
A100.927973851 
A119.357774268 
A1212.00309514 

 

I am using this measure but I am not getting the required output

Percentile =
VAR TotalVal =
    [Value Total]
RETURN
    IF(
        HASONEVALUE(Data[ID]),
        COALESCE(
            DIVIDE(
                CALCULATE(
                    COUNTROWS(Data),
                    FILTER(
                        ALLEXCEPT(Data,Data[ID]),
                        Data[Value] < TotalVal
                ),
                CALCULATE(
                    COUNTROWS(Data),
                    ALLEXCEPT(Data,Data[ID])
                )
            ),
            0
        )
    )
 
Please help
1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @Cevola 

 

Based on the data you provided, what kind of output do you expect?

vzhangti_0-1689733267581.png

Reference can be made to such formulas.

PERCENTILE.EXC function (DAX) - DAX | Microsoft Learn

PERCENTILE.INC function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.