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

ALLEXCEPT with external filters

We are trying to get an ALLEXCEPT measure working also accounting for external filters.

In this example scenario, we want to remove ALL filters in the table EXCEPT the Year (Including all columns from DATE table such as Month etc).


aashritsingh_0-1707171886115.png

ALLEXCEPT works fine when no external filters are applied.  However, it ignores any filters appliedin the slicer.

aashritsingh_1-1707172100224.png

We also tried all selected with this code:

aashritsingh_2-1707172161998.png

But, it doesn't work and gives Amounts across the years.

 

To summarize, we want the visual to only keep DATE table filters and ignore every table filter while keeping external slicer filters. Our issue with ALLSELECTED is that it requires its Table Name to ignore filters. However, our model has around 18 different dimensions besides DATE_DIM which users can randomly choose from and it gets difficult to specify each table in ALLSELECTED.

 

Please suggest a best practice to accomplish this.

1 ACCEPTED SOLUTION

@aashritsingh 

allselected(fact_table) ,  values(dim_date[date])

 

 

let me know if it works for you . 

 

 

View solution in original post

4 REPLIES 4
Daniel29195
Super User
Super User

@aashritsingh 

 

allselected if the only function that returns the external slicer filters and get rid of the visual filters .

 

i m afraid there is no other way in DAX  (that i know of ) to be able to maintain the slicer filters while removing the visual filters .

 

 

if you have a starschema, maybe try to use allselected(fact_table) , 

 

let me know if it works for you . 

 

best regards

 

 

 

Hello @Daniel29195 

 

I did try using ALLSELECT(Fact Table). Although, it maintain external filters, but, removes all the context filters from the table. We just want to keep the filters on DATE_DIM. Is there a way to maintain that or, add the DATE_DIM filter after ALLSELECT processing?

@aashritsingh 

allselected(fact_table) ,  values(dim_date[date])

 

 

let me know if it works for you . 

 

 

@Daniel29195 

 

This solution has worked. Thank you for the help 🙂

 

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.