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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ilhamfadhillah4
New Member

Calculate percentile with filters

Hi everyone,

 

So I have a problem with calculating percentiles filtered based on the value of another column, here's an example:

ilhamfadhillah4_0-1678947825804.png

The data that I have is in the left table, I want to add the 'Percentile' column in the same table containing the percentile value of the total budget in the account for that row, so the end result should be like the one in the right. My current formula is as follows:

PERCENTILE = PERCENTILE.EXC(Table[Budget],0.8)

Which returns overall percentile of the data instead of it being the percentile of each account. I tried the following formula as well:

PERCENTILE = CALCULATE(PERCENTILE.EXC(Table[Budget],0.8),Table[Account])

 Which returns an error because the filter expression returns a string value and cannot be converted into a true/false.

How do I make sure that the percentile value in each row is specific to the percentile value for the account in that row? So any row with the same account will return the same value. Thanks in advance!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

PERCENTILE = CALCULATE(PERCENTILE.EXC(Table[Budget],0.8),ALLEXCEPT(Table,Table[Account]))

this would be one option, but it's a rather blunt instrument. You may need to use different filter context manipulations.

View solution in original post

2 REPLIES 2
ilhamfadhillah4
New Member

I just tried that and it works, thank you so much!

lbendlin
Super User
Super User

PERCENTILE = CALCULATE(PERCENTILE.EXC(Table[Budget],0.8),ALLEXCEPT(Table,Table[Account]))

this would be one option, but it's a rather blunt instrument. You may need to use different filter context manipulations.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.