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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

find a proper filter function to de-active only two filter out of 5 other filters at the dashboard

I've created a measure to calculate count of the date events and don't want to count them while two of the filters applies but need other filters to work .

filters are the date slicer , market name , user name and three other category filter .

I want to disable two of the filters but keep the measuere value with regards by any other filter selection I came up with below DAX formulas : 

1 - CALCULATE (COUNT('Table'[Date]),

REMOVEFILTERS('Table'[Category1]),
REMOVEFILTERS('Table'[Category2]) )

 

2-  CALCULATE(

COUNT(Table'[Date]),
REMOVEFILTERS('Table'[Category1]),
REMOVEFILTERS('Table'[Category2]),
ALL('Table'[Date],'Table'[Market])
)
3-

CALCULATE(

COUNT(Table'[Date]),
REMOVEFILTERS('Table'[Category1]),
REMOVEFILTERS('Table'[Category2]),
ALLSELECTED('Table'[Date],'Table'[Market])
)
4-
CALCULATE(
COUNT(Table'[Date]),
ALLEXCEPT('Table'[Date]),'Table'[Market])
)
The only one doesn't change with the two category filter is the first one but also doesn't change with other filters 
I need to only de activate two category filters while others working .
Does the data type of the filter column impacts on how to filter function works ?
Can you advise what is wrong here ?
Thank you 
1 ACCEPTED SOLUTION

Hi,

If filters aren't functioning properly and it seems likely that the problem is in data the first thing I usually do is to look at whether or not the relationships are working and if they are they the wrong type. E.g. if the relationship is many to many or if there are duplicate rows in data. E.g. if you have category 1 and 2 for all the dates the filters wouldn't do anything.

Also in this case one of the easier solutions would be to use a separate dimension table. 

Example (table 7 = fact table 10 = dimension):
10:

ValtteriN_3-1661075914101.png


7:

ValtteriN_4-1661075930058.png

 

ValtteriN_0-1661075711748.png


Here we can see that the filter created from fact table has no effect on the Filter behaviour:

ValtteriN_1-1661075788941.png


Now when we apply a filter from dimension table the calculation chnages:

ValtteriN_2-1661075818849.png


This way we can remove the filter context in the measure using ALL/REMOVEFILTERS but still have slicers that affect the calculation.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Awesome !!! I learned something new and it works .

ValtteriN
Super User
Super User

Hi,

Based on the DAX you are using the first measure should work. I believe the issue might be the data. Also you could use ALL instead of REMOVEFILTERS (this is just a personal preference).

CALCULATE (COUNT('Table'[Date]),

ALL('Table'[Category1],
'Table'[Category2]) )






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thank you so much for your reply,I think also the issue may be from the data any idea that how data may impact on the function of the filters ? when I apply the category filter it acts diffrent than it supposed to be and doesn't filter correctly  it looks filters from a diffrent table of own.

 

Hi,

If filters aren't functioning properly and it seems likely that the problem is in data the first thing I usually do is to look at whether or not the relationships are working and if they are they the wrong type. E.g. if the relationship is many to many or if there are duplicate rows in data. E.g. if you have category 1 and 2 for all the dates the filters wouldn't do anything.

Also in this case one of the easier solutions would be to use a separate dimension table. 

Example (table 7 = fact table 10 = dimension):
10:

ValtteriN_3-1661075914101.png


7:

ValtteriN_4-1661075930058.png

 

ValtteriN_0-1661075711748.png


Here we can see that the filter created from fact table has no effect on the Filter behaviour:

ValtteriN_1-1661075788941.png


Now when we apply a filter from dimension table the calculation chnages:

ValtteriN_2-1661075818849.png


This way we can remove the filter context in the measure using ALL/REMOVEFILTERS but still have slicers that affect the calculation.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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