Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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?
  • 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()))

2 Replies

  • 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()))

    • Anonymous's avatar
      Anonymous
      Not applicable

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

       

      also AllSelected() is not taking in if function