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
DataMark
Regular Visitor

PERCENTILE with filter / conditions

Hi,

 

Have a question about using percentiles (PERCENTILE.EXC or PERCENTILE.INC) with a filter / conditions. Suppose I have two tables, one with all sales for all items and another with sales for new produts. What I am trying to find is the 1st quartile / 25% of all sales based on the category the new product is classified in as a benchmark for success / failure. 

 

In the example below, I would want to return the 1st quartile for DOG. In Excel, the formula would be something like:

=PERCENTILE.INC(IF([Category]="DOG",[Sales]),0.25). I tried using FILTER in DAX, but can't seem to get the result. 

 

Table 1: 

CategorySales
DOG19
CAT17
DOG16
DOG9
CAT12
DOG14
CAT1
DOG4
CAT1
DOG20
CAT11

 

Table 2: 

ProductCategorySales1st Quartile
Delicious Dog FoodDOG156.5

 

Thanks!

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @DataMark 

 

Column:

DOG Sales = IF([Category]="DOG",[Sales])

Measure:

Measure = PERCENTILE.INC([DOG Sales],0.25)

vzhangti_0-1644916997571.png

Is this the result you expect?

 

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.

DataMark
Regular Visitor

Thanks for the reply.

 

I need to filter the formula for 2 reasons: 1) a measure for success needs to be calculated. This will look like =IF(Sales > Category Percentile, SUCCESS, FAILURE) and 2) Need to do the same exercise but for other product attributes, like MARKET, PRICE CLASSIFICATION (low, medium, high) and so on

littlemojopuppy
Community Champion
Community Champion

Hi @DataMark 

 

There are two functions that can probably help you.  PERCENTILE.INC and PERCENTILEX.INC.  

 

The formula should be this simple.

PERCENTILE.INC(
	Table[Sales],
	.25
)

Shouldn't need to filter the formula because filter context in the visualization should take care of that for you (meaning it will automatically filter for Category DOG and Product Delicious Dog Food).

 

Hope this helps!

 

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.