Forum Discussion

tjalleph's avatar
tjalleph
Frequent Visitor
6 years ago
Solved

Dynamic and categorized distinct counting

Hi all,   I'm fairly new to Power BI and trying to do something that could be called dynamic and categorized distinct couting.    A simplified sample of my data would like this: ID Category ...
  • sturlaws's avatar
    6 years ago

    Hi tjalleph ,

     

    you can write your measures like this:

    m0 =
    COUNTROWS (
        FILTER (
            ADDCOLUMNS (
                VALUES ( 'Table'[ID] );
                "maxCodedAnswer"; CALCULATE ( MAX ( 'Table'[Coded_answer] ) )
            );
            [maxCodedAnswer] = 0
        )
    )

     

    Cheers,
    Sturla

    If this post helps, then please consider Accepting it as the solution. Kudos are nice too.