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
rbhattacharya
Helper I
Helper I

DAX Expression to remove an existing filter and apply new one

Hello,

 

I have a Date filter in the report where I'm selecting current month. I have a requirement where I will have to calculate a certain measure with a new filter value i.e. remove the current filter and reapply a new filter. I'm restricted to using a single filter in the report which is set to current month. I'm using the following DAX expression currently where my current filter is set to "January" and I'm trying to retrieve data for "December":

 

TechnicalEmpHeadcountProjection = CALCULATE([Technical Employee Headcount *], FILTER(ALL('Budgeting v_IncomeStatement'[PeriodFormatted].[Month]), 'Budgeting v_IncomeStatement'[PeriodFormatted].[Month]= "December"))

 

The above DAX expression doesn't seem to work. [PeriodFormatted] is my Date column. I'm also attaching a screenshot.

 

Kindly assist me with the DAX.

 

Capture.JPG

 

Regards,

RB

 

 

1 ACCEPTED SOLUTION

Hello,

 

I was able to use "ALL" and remove existing filter. Then apply new filter to this solved the issue. Took me some time to figure out the DAX. Listing the new DAX for reference. 

 

TechnicalEmpHeadcountProjection = CALCULATE (SUM('Budgeting v_IncomeStatement'[TechnicalEmpHeadcountRevisedCol]), ALL('Budgeting v_IncomeStatement'[PeriodFormatted].[Month]), 'Budgeting v_IncomeStatement'[PeriodFormatted].[Month] = "December")
 
Regards,
RB

View solution in original post

3 REPLIES 3
LL11SJL
New Member

thanks! just used this - helped hugely!!😀

 

lbendlin
Super User
Super User

Have you tried using REMOVEFILTERS()  or a disconnected table to feed your slicer?

Hello,

 

I was able to use "ALL" and remove existing filter. Then apply new filter to this solved the issue. Took me some time to figure out the DAX. Listing the new DAX for reference. 

 

TechnicalEmpHeadcountProjection = CALCULATE (SUM('Budgeting v_IncomeStatement'[TechnicalEmpHeadcountRevisedCol]), ALL('Budgeting v_IncomeStatement'[PeriodFormatted].[Month]), 'Budgeting v_IncomeStatement'[PeriodFormatted].[Month] = "December")
 
Regards,
RB

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