Forum Discussion
Jeremy19
2 years agoHelper 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 !
Hi,
Please find attached the PBi file.
3 Replies
- Dangar332Resident Rockstar
hi, Jeremy19
try REMOVEFILTERS(Feuil1) --- it remove all filters from expanded table but you have to aware about expanded tablehere 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.
- Jeremy19Helper III
Thank you. If I want to add other filters like the date, they have to be in tables outside my filtered table.
- Ashish_MathurSuper User