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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
bhuprakashs
Helper I
Helper I

Conditional formatting based on percentile value

Hi Experts,

I have a requirement to implement color coding in table metrics based on 50% percentile. (below pic from excel)

bhuprakashs_0-1732707656132.png


Result in Excel:

bhuprakashs_0-1732708082367.png

 

 

Same conditional formatting I want to implement in powerbi but not able to make it. I have tried below in Powerbi not desired output is not coming because I am using 50 percent not the percentile. I am not aware how to calculate percentile in powerbi.

PowerBI Implementation by me:

bhuprakashs_3-1732707893875.png

bhuprakashs_4-1732707923282.png

Kindly help me how can I achieve this . Thank you

 

 

1 ACCEPTED SOLUTION
bhuprakashs
Helper I
Helper I

thanks @Bibiano_Geraldo  for the solution but unfortunately is not working in my case because I have do not have direct column to use in formula. there is already measure created from multiple measures so giving incorrect result for me.

View solution in original post

2 REPLIES 2
bhuprakashs
Helper I
Helper I

thanks @Bibiano_Geraldo  for the solution but unfortunately is not working in my case because I have do not have direct column to use in formula. there is already measure created from multiple measures so giving incorrect result for me.

Bibiano_Geraldo
Super User
Super User

Hi @bhuprakashs ,
Power BI has a built-in function called PERCENTILEX.INC, which calculates percentiles. For the 50th percentile (median), you can create a measure like this:

 

Percentile 50 = 
PERCENTILEX.INC(
    ALL('Table'[Column]),  -- Replace 'Table' and 'Column' with your table and column names
    'Table'[Column],       -- The column you want the percentile of
    0.5                    -- 50% percentile (for the median)
)

 

 

Now that you have the 50th percentile, you can use it to create a measure for conditional formatting. For example:

 

Color Code Measure = 
VAR MedianValue = [Percentile 50]
VAR CurrentValue = SUM('Table'[Column])  -- Replace with your metric column
RETURN
    IF(CurrentValue < MedianValue, 1, 
        IF(CurrentValue = MedianValue, 2, 3))

 

 

1 could represent a value below the median (you can assign a color like red).

2 could represent a value equal to the median (use a neutral color like yellow).

3 could represent a value above the median (you can assign a color like green).

 

This way, you'll achieve a similar color coding in Power BI as you had in Excel based on the 50th percentile.

 

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.