Forum Discussion

Astolfo's avatar
Astolfo
Frequent Visitor
3 years ago
Solved

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 ,

    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

     

  • Anonymous's avatar
    Anonymous
    3 years ago

    Does this work for you? 

     

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

3 Replies

  • 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

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Does this work for you? 

     

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