Forum Discussion

tmhalila's avatar
tmhalila
Icon for Resolver II rankResolver II
4 years ago
Solved

Creating a measure for category

Hello, I have a dataset with two tables, one for the age group and the other for services completed. I want to create a visual by category of the age group for those who completed one service, two s...
  • TheoC's avatar
    TheoC
    4 years ago

    Hi tmhalila 

     

    Haha - alright, that sounds good.  You can use the following to create a calculated column:

     

    _colDistinctClientServices = 

    CALCULATE
    DISTINCTCOUNT ( Services[serviceid] ) , 
    ALLEXCEPT ( 'Services' , Services[clientid] ) , Services[_CompletedServices] = "Completed"
    )

     

    Once you have added the column, you can then drag it onto the visual as the "Legend".  This will give you the following:

     

    Power BI file attached 🙂

     

    Theo