Forum Discussion

puneethjp's avatar
puneethjp
Icon for Helper II rankHelper II
2 years ago
Solved

Removefilters not working as expected.

Hi, 

 

I have list of filters as below. 

 

Requirement: 

Incr. $ share`=Sum(incr. $)/SUM(mega category $)*100 Numerator= sum(incr $ for any selected in filters)Denominater : disregard any filters:  the ppg,mfg, brand,catogery and consider only mega catogery

 

I have written a DAX query as : 

$ increment share = CALCULATE(DIVIDE(SUM(Fact_Promo_Scorecard[incr_dollar]), CALCULATE(SUM(Fact_Promo_Scorecard[incr_dollar]),REMOVEFILTERS(Dim_Product[mi_ppg1],Dim_Product[category],Dim_Product[mi_key_brand])
,REMOVEFILTERS(Dim_Market[mi_key_mfr]))))*100.  
 
Got an output as below: Which is equal to one. 
 

 

 

As shown below, the first half and second half of the query is giving me same values: 

 

The first section yellow and second section green are actually giving us same values . When divided it is 1. multiplied it is 100.

 

Could you please help me with the query.

 

Thanks 

Puneeth

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi puneethjp ,

     

    Consider using other DAX functions: If the "REMOVEFILTERS" function is not giving you the desired results, you can try using other DAX functions like "ALL", "ALLEXCEPT", or "CALCULATETABLE" to manipulate the filter context and achieve the desired outcome.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi puneethjp ,

     

    Consider using other DAX functions: If the "REMOVEFILTERS" function is not giving you the desired results, you can try using other DAX functions like "ALL", "ALLEXCEPT", or "CALCULATETABLE" to manipulate the filter context and achieve the desired outcome.

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

    • puneethjp's avatar
      puneethjp
      Icon for Helper II rankHelper II

      Hi Anonymous 

       

      KeepFilters , All Except  worked. 

       

      Thank you.