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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ERing
Post Partisan
Post Partisan

How to I calculate the Percentile using a measure?

I have a report with a visual like below that shows survey results for sales representatives.

I've been asked to provide a conditional formatting of the Delta column, using percentile to set the conditions for the formatting.

To acheive this, my first step is creating measures for the percentiles I'll be using.

The issue I'm facing is that each of the three columns in my visual is a measure and my understanding is that the PERCENTILE function requires a column.

I need help in how to calculate the 75th percentile 

Score for Opportunities Closed = 
CALCULATE(
DIVIDE(SUM(Table[Scores]),COUNT(Table[Opportunity_ID])),
KEEPFILTERS(TABLE[Closed_Flag = 1))

Score for Opportunities Not Closed = 
CALCULATE(
DIVIDE(SUM(Table[Scores]),COUNT(Table[Opportunity_ID])),
KEEPFILTERS(TABLE[Closed_Flag = 0))

Delta = [Score for Opportunities Not Closed] - [Score for Opportunities Closed]


This the my matrix visual layout

1.png

This is how my data is structured:

Opportunity_IDScore_SubcategoryScore_CategoryClosed_Flag
1Setting AgendaProcess1
1BudgetingProcess1
1Call ManagerProcess1
1Offer SurveyProcess1
1AnalysisProcess1
1GuaranteeProcess1
1ReferralProcess1
1SchedulingProcess1
1SitdownProcess1
1Building RapportSkills1
1ClosingSkills1
1Find a needSkills1
1Objection HandlingSkills1
2Setting AgendaProcess0
2BudgetingProcess0
2Call ManagerProcess0
2Offer SurveyProcess0
2AnalysisProcess0
2GuaranteeProcess0
2ReferralProcess0
2SchedulingProcess0
2SitdownProcess0
2Building RapportSkills0
2ClosingSkills0
2Find a needSkills0
2Objection HandlingSkills0
1 ACCEPTED SOLUTION

The solution was to use PERCENTILEX with ALLSELECTED for both Dimensions. So the measure I ended up with is: 

PERCENTILE75 = PERCENTILEX.EXC(ALLSELECTED('Table'[Score_Category],'Table'[Score_Subcategory),'Table'[Delta],.75)




View solution in original post

10 REPLIES 10
v-pagayam-msft
Community Support
Community Support

Hi @ERing ,
Thank you @maruthisp and @SreeniBattula for the helpful responses!

I tried to recreate it on my local upon my understanding.Please refer the screenshot and file for your reference.

vpagayammsft_0-1749800141797.png


If this answer meets your requirements,give us kudos and consider accepting it as solution. If still require further assistance, feel free to reachout!

Thank you.

Regards,
Pallavi

Thanks @v-pagayam-msft  I have found the solution elsewhere.

Hi @ERing ,
Thank you for the update!Glad you found a solution. Please share your answer and accept it as solution so others in the community who faces similar issues may find it easily.

Thank you for your understanding.


The solution was to use PERCENTILEX with ALLSELECTED for both Dimensions. So the measure I ended up with is: 

PERCENTILE75 = PERCENTILEX.EXC(ALLSELECTED('Table'[Score_Category],'Table'[Score_Subcategory),'Table'[Delta],.75)




maruthisp
Super User
Super User

Hi ERing,

 

I tried to implement a solution based on your original post description.
Please check the below pbix file:
calculate the Percentile using a measure.pbix

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

Thanks @maruthisp , however this doesn't provide the expcted solution. The expected value should be 3.83.

I sorted the values in the Delta column. The 75th percentile would be equal to the 9th number. 

 

So the value in Delta_75th_Percentile should be 3.83 for all the values in that colum.

-30.00, -15.00, -9.00, -8.00, -7.40, -7.00, -7.00, -6.00, 3.83, 10.00, 20.00

SreeniBattula
Helper II
Helper II

Delta is % of Opportunities Not Closed vs Opportunities Closed? if not can you  provide me the expected out put in  the table .

@SreeniBattula Delta is Opportunities Not Closed - Opportunities Closed. Simply the difference between the two calculations.

SreeniBattula
Helper II
Helper II

Create "New measure" using the below DAX.

Delta =
DIVIDE(
[Score for Opportunities Not Closed] - [Score for Opportunities Closed]
,
[Score for Opportunities Closed]
)

 

Format the measure as a percentage:

@SreeniBattula I'm sorry but I don't follow how that provides a solution to my problem.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors