Forum Discussion

Jeremy19's avatar
Jeremy19
Helper III
2 years ago
Solved

Count without considering certain filters

Hello,
I have a table similar to this example:

 

IDColorTeamDate
1RedA30/09/2023
1GreenA30/09/2023
2RedA01/10/2023
1RedB30/09/2023
1GreenB30/09/2023
2GreenB01/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 !

3 Replies

  • Dangar332's avatar
    Dangar332
    Resident Rockstar

    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.

     

    • Jeremy19's avatar
      Jeremy19
      Helper III

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