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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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 4
wdx223_Daniel
Super User
Super User

CALCULATE function can not change the value of variables

Anonymous
Not applicable

@wdx223_Daniel 

 

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

 

Appreciate!

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.

Anonymous
Not applicable

@jameszhang0805 

 

Still the same behavior. I already created a measure instead of a variable.

 

Div1 =
(CALCULATE([ABC], REMOVEFILTERS('_sp-Total Invoiced to Date - Current Month')))

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors