Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

remove filter not working

I'm currently writing a DAX that will get the percentage between the total and the filtered amount.

 

This is what I have so far:

 

Totals =
var ABC = '_sp-Total Invoiced to Date - Current Month'[Total Invoiced Current] - [Current Cost & Expense]
 
RETURN divide((CALCULATE(ABC, REMOVEFILTERS('_sp-Opportunity Fees and Variations'[NAME]))) , (CALCULATE(ABC, ALLSELECTED('_sp-Opportunity Fees and Variations'))))
 
The problem is regardless of what filter I select I always get 100%. 
 
I tried creating a separte measure and still the REMOVEFILTERS is not working.
 
Div1 =

var ABC = '_sp-Total Invoiced to Date - Current Month'[Total Invoiced Current] - [Current Cost & Expense]

return (CALCULATE(ABC, REMOVEFILTERS('Projects'[Project Name])))
 
Thank you!

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      wdx223_Daniel 

       

      Do you have any suggestions on how can I achieve my goal?

       

      Appreciate!

      • jameszhang0805's avatar
        jameszhang0805
        Icon for Resolver IV rankResolver IV

        Create a measure of ABC instead of variables and try again. Once a measure was calculated and assigned to variables, the value was static, CALCULATE function can not change the value of variables just like Daniel mentioned.