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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
cn4422
Helper V
Helper V

Allexcept - Remove slicer

Hi,

 

I have a date slicer (Datum,Datum[Date]) and a country slicer.

 

I have the following DAX Measure, for which I want to remove all filters, except the date slicer.

I tried with ALLEXCEPT, but somehow it doens't remove the country slicer:

 

Count APF Status_Site_AT Filter =
CALCULATE(COUNT('lead'[Status 2]),
'lead'[Country construction site]="Österreich",
ALLEXCEPT(Datum,Datum[Date]))
 
Any ideas on that?
I'm thankful for help! 🙂
 
2 ACCEPTED SOLUTIONS
sjoerdvn
Super User
Super User

Count APF Status_Site_AT Filter =
CALCULATE(COUNT('lead'[Status 2]),
  ALL(),
  'lead'[Country construction site]="Österreich",
  VALUES(Datum[Date]))

View solution in original post

Well, the question was to remove all filters, and there is no real difference between row/column context and filter context.
There are two ways of fixing this
1) expand the current measure. The current measure uses ALL() to remove all filters, and then VALUES(Datum[Date]) to re-apply the dates in the active context. You can simply add that column in there (example below, adjust if the value is not from that table, but from a dimension table).
2) Alternatively, do not use ALL() but expand the context only for the slicers/filters you want overriden.

Count APF Status_Site_AT Filter =
CALCULATE(COUNT('lead'[Status 2]),
  ALL(),
  'lead'[Country construction site]="Österreich",
  VALUES(Datum[Date]),
  VALUES('lead'[Status 2])
)

Count APF Status_Site_AT Filter V2=
CALCULATE(COUNT('lead'[Status 2]),
  ALL('lead'[Country construction site]),
  ALL('tableA'[column x]),
  'lead'[Country construction site]="Österreich"
)

 

View solution in original post

9 REPLIES 9
sjoerdvn
Super User
Super User

Count APF Status_Site_AT Filter =
CALCULATE(COUNT('lead'[Status 2]),
  ALL(),
  'lead'[Country construction site]="Österreich",
  VALUES(Datum[Date]))

I just found out that it works almost perfectly... 🙂

One thing I noticed is that it puts the grand total into all cells and not for every category the correct sum.

 

Any idea on how to fix that?

 

2024-08-28 14_22_52-APF CRM Report 01_a.png

 

 

Well, the question was to remove all filters, and there is no real difference between row/column context and filter context.
There are two ways of fixing this
1) expand the current measure. The current measure uses ALL() to remove all filters, and then VALUES(Datum[Date]) to re-apply the dates in the active context. You can simply add that column in there (example below, adjust if the value is not from that table, but from a dimension table).
2) Alternatively, do not use ALL() but expand the context only for the slicers/filters you want overriden.

Count APF Status_Site_AT Filter =
CALCULATE(COUNT('lead'[Status 2]),
  ALL(),
  'lead'[Country construction site]="Österreich",
  VALUES(Datum[Date]),
  VALUES('lead'[Status 2])
)

Count APF Status_Site_AT Filter V2=
CALCULATE(COUNT('lead'[Status 2]),
  ALL('lead'[Country construction site]),
  ALL('tableA'[column x]),
  'lead'[Country construction site]="Österreich"
)

 


@sjoerdvn wrote:

Well, the question was to remove all filters, and there is no real difference between row/column context and filter context.

 

You're right of course - sorry, I'm still new to all this and so the "remove all filters" wasn't quite correctly formulated. 

 

Thanks for clarifying the issue and providing two solutions... I've tried the first one and now it's working just fine! 👌

Thanks, that worked like a charm! 👍

Rupak_bi
Super User
Super User

Hi ,

Try This

Count APF Status_Site_AT Filter =
CALCULATE(COUNT('lead'[Status 2]),
'lead'[Country construction site]="Österreich",
FILTER(ALL(Datum),Datum[Date]=selectedvalue(Datum,[Date]))


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Thanks for your reply!

 

I had to change the last line of the code slightly, because of an error message:

FILTER(ALL(Datum),Datum[Date]=selectedvalue(Datum[Date])))

Now the error message is gone, but unfortunately the value = empty.
 
2024-08-27 16_08_16-APF CRM Report 01.png

 

Plz share sample data



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Thanks for your help, much appreciated!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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