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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Get Calculation based on the Filtered Selection

Hi,

I'm trying to calculate Outliers by IQR method for which I need to first calculate Quartile 1 and Quartile 3 for the below data.

 

StoreBrandQty_ordered
1A162
2A119
3A132
4A152
5A142
1B148
2B126
3B151
4B195
5B153
6B113
1C171
2C183
3C200
4C136
5C142
6C180

 

I have a filter on the brand, which when selected I want the Quartile 1 and Quartile 3 for that particular brand, else it has to be for all the brands. 

 

Quart1 = CALCULATE(PERCENTILE.INC('[total_qty_ordered],0.25),IF(ISFILTERED([brand_label]),[brand_label]=[brand_label]),AllSelected()))
 
I thought of this, but "[brand_label]=[brand_label]" this part is giving an error. what do I do?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , use selected value or max

 

CALCULATE(PERCENTILE.INC([total_qty_ordered],0.25),IF(ISFILTERED([brand_label]),filter(Table[brand_label]=selectedvalue([brand_label])),AllSelected()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , use selected value or max

 

CALCULATE(PERCENTILE.INC([total_qty_ordered],0.25),IF(ISFILTERED([brand_label]),filter(Table[brand_label]=selectedvalue([brand_label])),AllSelected()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

nithin2050_0-1645446702823.png

Filter works with table, not able to work with a column

 

also AllSelected() is not taking in if function

 

nithin2050_1-1645447123719.png

 

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.