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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

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.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.