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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors