Forum Discussion

Tito's avatar
Tito
Helper IV
1 year ago
Solved

Add filter

Hello everyone,

I need a filter to see the names which their number is greater than 1.
If the sum of the number is empty or equal to 1, then " empty or equal to 1" otherwise "greater than 1"

 

Raw data

IDNameStatusGroup
1WilliamYesA
2WilliamNoB
3WilliamYesC
4MaxNoA
5MaxYesC
6LucaYesD
7MarvinYesA
8MarvinNoB
9MaxNoB
10MaxYesD

 

 

 

Result:

  • Tabelle
Name# Yes# NoSum
William213
Max224
Luca1 1
Marvin112

 

 

 

  • Slicer:
    Empty or equal to 1
    greater than 1

Thank you

Tito

  • Hi Tito 

    Assuming your definition of number is the  count of records per name, create this calculated column.

    Slicer Column =
    VAR _CountPerName =
        CALCULATE ( COUNTROWS ( 'table' ), ALLEXCEPT ( 'table', 'table'[name] ) )
    RETURN
        IF ( _CountPerName > 1, "greater than 1", "Empty or equal to 1" )
    

3 Replies

  • Hi Tito 

    Assuming your definition of number is the  count of records per name, create this calculated column.

    Slicer Column =
    VAR _CountPerName =
        CALCULATE ( COUNTROWS ( 'table' ), ALLEXCEPT ( 'table', 'table'[name] ) )
    RETURN
        IF ( _CountPerName > 1, "greater than 1", "Empty or equal to 1" )
    
    • Tito's avatar
      Tito
      Helper IV

      Hi danextian ,

       

      Thank you very much. I have adjusted your measure:

      Slicer Column =
      VAR _CountPerName =
          CALCULATE ( DISTINCTCOUNT( 'table' ), ALLEXCEPT ( 'table', 'table'[name] ) )
      RETURN
          IF ( _CountPerName > 1, "greater than 1", "Empty or equal to 1" )