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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
RemyBosman
Helper II
Helper II

Removefilters not working

Hi All,

 

I'm writing a DAX Query which exectutes different parts of the query depending on the current filter. This logic works, however: 
In example #1, de removefilters works just fine. I'm getting values over a range of dates.
In example #2, the removefilters does not work. The result is a value on a single date.


It seems to be caused by the filter statement which i marked with as #3. Does anyone know if performing a removefilter together with another filter in the Calculate statement does't work? I can imagine the fact table inside #3 is still filtered by the date table. But how to get rid of the Date filter there? 
I've tried to work with ALLEXCEPT(FACT,COLUMN,ETC). But so far no result. 

2020-11-11 20_42_27 - Power BI Desktop.png

 

Any help is appreciated.

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

@RemyBosman try to add another CALCULATE out of your code and move REMOVEFILTERS outside, such as 

IsLevelDfiltered=CALCULATE(CALCULATE(SUM,FILTER,DATEBETWEEN),REMOVEFILTER)

View solution in original post

5 REPLIES 5
RemyBosman
Helper II
Helper II

Thanks Daniel! Works like a charm! 🙂

wdx223_Daniel
Super User
Super User

@RemyBosman try to add another CALCULATE out of your code and move REMOVEFILTERS outside, such as 

IsLevelDfiltered=CALCULATE(CALCULATE(SUM,FILTER,DATEBETWEEN),REMOVEFILTER)

This works, but why? I would think it would remove the filter in the inner Calculate also, but it doesn't.

AlB
Super User
Super User

Hi @RemyBosman 

By using the whole table 'Transformatie Dim_HoldingDate' as base for the FILTER( ) in #3, you are basically "bringing back in" whatever filter context is active on that table. If you are only filtering on the [NODE_NO] column, you can better use: 

FILTER( ALL('Transformatie Dim_HoldingDate'[NODE_NO]), 'Transformatie Dim_HoldingDate'[[NODE_NO] = RELATED(.....))

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Hi AlB,

I'm not using the holdingdate in the Filter in #3, did you accidently read it wrong, or do I misunderstand you?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors