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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Jeremy19
Helper III
Helper III

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 !
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Please find attached the PBi file.

Ashish_Mathur_0-1696119094387.png

 


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Please find attached the PBi file.

Ashish_Mathur_0-1696119094387.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Dangar332
Super User
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 

Dangar332_0-1696094324393.png

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.

 

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
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.