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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

## Count without considering certain filters

Hello,
I have a table similar to this example:

 ID Color Team Date 1 Red A 30/09/2023 1 Green A 30/09/2023 2 Red A 01/10/2023 1 Red B 30/09/2023 1 Green B 30/09/2023 2 Green B 01/10/2023

I want to create a measure that calculates the number of distinct ID without considering the Color filter. So I created this measure :

Nb id = CALCULATE(DISTINCTCOUNT(Feuil1[id]),REMOVEFILTERS(Feuil1[Color]))

I create a matrix with the team for the rows and [Nb id] in value. I get 2 for A and 2 for B. Adding the Color = Red filter gives the same result but when I add the filter : Date > 01/01/2020, the value for B becomes 1 and is therefore false.

Do you know how to modify this measure, knowing that I need to filter by date?

Thanks !
1 ACCEPTED SOLUTION
Super User

Hi,

Please find attached the PBi file.

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
3 REPLIES 3
Super User

Hi,

Please find attached the PBi file.

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Super User

hi, @Jeremy19
try REMOVEFILTERS(Feuil1)  --- it remove all filters from expanded table but you have to aware about expanded table

here i attach screenshot

nb id =CALCULATE(DISTINCTCOUNT(feuil1[id]),REMOVEFILTERS(feuil1))

but you have to aware about expanded table because here  REMOVEFILTERS(Feuil1)  remove filters from expanded table

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Helper III

Thank you. If I want to add other filters like the date, they have to be in tables outside my filtered table.

## Helpful resources

Announcements

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors