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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.