Can I have a dimension as a result of a calculated measure (i want to use in a donut chart)?

If i use count_distinct() in calculate measure then it returns a measure which I can’t then use in a donut chart.

e.g. i want distinct usage days per user. I have:
userID, usage_date
1,‘2022-09-01’
2,‘2022-09-02’
1,‘2022-08-03’
2,‘2022-09-02’
2,‘2022-09-02’

I’d like to have it grouped so:
userID, CF_UsageDaysCount
1,2
2,1

Is the only way to have it pre-aggregated in the source dataset? As I need the same data also at detail level.

Why can’t you use it in a donut chart ? if you use the measure as a value, you can add “userID” as a group/color. If you want to use the measure as the group/color, I think you need to do it in the dataset

@Eleri

Yes @EvaB is correct.

Here is how it might look for your use case. You don’t have to make a count_distinct calculated field. You just need to add the usage_date as the value and take the count distinct value of it.