Forum Discussion
tmhalila
Resolver II
4 years agoCreating 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...
- 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
tmhalila
Resolver II
4 years agoFinally, Solved!! 🎶 thanks a lot and more blessings, you saved my day!! I just modified it a little bit here
Service Category =
VAR _colDistinctClientServices =
CALCULATE ( DISTINCTCOUNT ( Services[serviceid] ) , ALLEXCEPT ( 'Services' , Services[clientid] ) , Services[CompletedService] = 1
)
VAR _servicecategories =
SWITCH( TRUE,
_colDistinctClientServices <1, " ",
_colDistinctClientServices =1, "Completed One",
_colDistinctClientServices =2, "Completed Two",
"completed Three or More"
)
Return
_servicecategories