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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
chillpill
Helper I
Helper I

Add percentile group per row as a calculated column with DAX?

I have a list of names and their data. I would like to add a column to show which person is in which grouping. I would like to group by 50%, 40% and 10% if that's posisble. I have tried with PERCENTILE.EXC but I am not getting the expected results. How would I accomplish this? Or would it need to be a measure instead of a calculated column?

 

NameDataPercentile
John Smith| 0.259309605| 25%
Mary Smith| 0.332877138 | 25%
Mark Smith| 0.899507702| 50%
Jerry Smith| 0.805348293| 50%
Danny Smith| 0.267092547| 50%
Marg Smith| 0.272978056| 50%
Able Smith| 0.392131121| 10%
Mike Smith| 0.534344624| 10%
Brert Smith| 0.874071811| 25%
Hanny Smith| 0.872285147| 50%
Mick Smith| 0.508295626| 10%

 

1 ACCEPTED SOLUTION
techies
Resolver V
Resolver V

Hi @chillpill please try this

 

Percentile_Group_Measure =
VAR CurrentValue = MAX(Sheet3[Data])
VAR P10 = PERCENTILEX.INC(ALL(Sheet3), Sheet3[Data], 0.90)
VAR P50 = PERCENTILEX.INC(ALL(Sheet3), Sheet3[Data], 0.50)

RETURN
SWITCH(
    TRUE(),
    CurrentValue >= P10, "10%",  
    CurrentValue >= P50, "40%",  
    "50%"  
)

View solution in original post

6 REPLIES 6
sevenhills
Super User
Super User

If you want it as a calculated column, same like @chillpill solution, you can use this:

Percentile_Group_col = 
VAR CurrentValue = Table3[Data] 
VAR P10 = PERCENTILEX.INC( Table3 , Table3[Data], 0.90)
VAR P50 = PERCENTILEX.INC( Table3 , Table3[Data], 0.50)

RETURN
SWITCH(
    TRUE(),
    CurrentValue >= P10, "10%",  
    CurrentValue >= P50, "40%",  
    "50%"  
)

 

output:

sevenhills_0-1742599527731.png

 

techies
Resolver V
Resolver V

Hi @chillpill please try this

 

Percentile_Group_Measure =
VAR CurrentValue = MAX(Sheet3[Data])
VAR P10 = PERCENTILEX.INC(ALL(Sheet3), Sheet3[Data], 0.90)
VAR P50 = PERCENTILEX.INC(ALL(Sheet3), Sheet3[Data], 0.50)

RETURN
SWITCH(
    TRUE(),
    CurrentValue >= P10, "10%",  
    CurrentValue >= P50, "40%",  
    "50%"  
)

Is this a calculated column or applied as a measure?

measure

Wonderful, thank you! If I wanted to have the measure dynamically update based on a slicer/filter - how would that be possible? I removed the ALL() function from your measure but that didn't change anything.

replace ALL with ALLSELECTED

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors