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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Astolfo
Frequent Visitor

Exclude some values from distinctcount

Hi all, 

i have a list of brands that i filter  by year and week and i show the distinct number of them with this function: 

Brands = DISTINCTCOUNT( Cartel1[Fornitore])
Want to know if i can exclude some of them from the count, for example ADIDAS and Giorgio Armani.
Thank you!

Astolfo_0-1678463029589.png

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Astolfo ,

Brands =calculate( DISTINCTCOUNT( Cartel1[Fornitore]),filter(Cartel1,not [Fornitore] in {"ADIDAS","Giorgio","Armani"})) 

 

or refer to exclude using slicer- Power BI Exclude selected Slicer value, Independent Table: https://youtu.be/lOEW-YUrAbE

 

View solution in original post

HassanAshas
Helper V
Helper V

Does this work for you? 

 

Brands = DISTINCTCOUNT ( Cartel1[Fornitore] )

Total Brands =
CALCULATE (
    [Brands],
    FILTER ( Cartel1, not [Fornitore] in {"ADIDAS","Giorgio Armani"} )
)

View solution in original post

3 REPLIES 3
Astolfo
Frequent Visitor

Both measures work well, many thanks!!!

HassanAshas
Helper V
Helper V

Does this work for you? 

 

Brands = DISTINCTCOUNT ( Cartel1[Fornitore] )

Total Brands =
CALCULATE (
    [Brands],
    FILTER ( Cartel1, not [Fornitore] in {"ADIDAS","Giorgio Armani"} )
)
amitchandak
Super User
Super User

@Astolfo ,

Brands =calculate( DISTINCTCOUNT( Cartel1[Fornitore]),filter(Cartel1,not [Fornitore] in {"ADIDAS","Giorgio","Armani"})) 

 

or refer to exclude using slicer- Power BI Exclude selected Slicer value, Independent Table: https://youtu.be/lOEW-YUrAbE

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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