Forum Discussion

yuvalpi's avatar
yuvalpi
Helper I
4 years ago
Solved

count unique record based on several columns

hi, i have a question regarding unique records. i have the following table: key description release 111 item for sale rel1 111 item for sale rel1 111 item for sale rel2 111 ...
  • SpartaBI's avatar
    SpartaBI
    4 years ago

    yuvalpi OKK 🙂 So I didn't understand what you meant.
    This is the column you need:

     

    Column 2 = 
    VAR _current_key = 'Table'[key]
    VAR _result = 
        CALCULATE(
            DISTINCTCOUNT( 'Table'[release] ),
            REMOVEFILTERS('Table'),
            'Table'[key] = _current_key
        )
    RETURN
        _result

     

     







          

    Showcase Report – Contoso By SpartaBI

  • SpartaBI's avatar
    SpartaBI
    4 years ago

    yuvalpi you mean like this?:

     

    Column 2 = 
    VAR _current_key = 'Table'[key]
    VAR _result = 
        CALCULATE(
            DISTINCTCOUNT( 'Table'[release] ),
            REMOVEFILTERS('Table'),
            'Table'[key] = _current_key,
            'Table'[release] <> BLANK()
        )
    RETURN
        _result

     





          

    Showcase Report – Contoso By SpartaBI