Donut chart of average measurement by group

table has countryCode, reportYearMonth, retentPercent
XX, 2024-11-01, 1
XX, 2024-10-01, 1
YY, 2024-11-01, 0.9
YY, 2024-10-01, 0.8
ZZ, 2024-09-01, 0.8
ZZ, 2024-10-01, 1
ZZ, 2024-11-01, 0.9

how to plot a donut chart using average of retentPercent of specific reportYearMonth and countryCode such that
(a) 2024-10-01 to 2024-11-01 is 1 (33.3%) is 100% retention and 2 (66.7%) is below 100% retention
(b) 2024-10-01 to 2024-10-01 is 2 (66.7%) is 100% retention and 1 (33.3%) is below 100% retention
?

Hi @lbl - You can use filter and calculated field to achieve this. I used a calculated field “retentionformonth” with the formula below:

ifelse(retentPercent=1,‘Retention is 100%’,‘Retention is less than 100%’)

Then i applied a filter to the dashboard to choose the month i want to see. My donut chart looks as shown in the screenshot below.

2 Likes

@awsvig
ifelse(retentPercent=1,‘Retention is 100%’,‘Retention is less than 100%’) is applied at each reportYearMonth level. Hence, the solution will not work for range of 2024-10-01 to 2024-11-01. Correct me if my understanding is wrong.

Thanks.

1 Like

Hi @lbl,
It’s been awhile since last communication on this thread, did you test out the solution provided above and did it not return to correct output? If you setup a filter for your desired date range on the visual, it will filter down to data only for those dates if that’s what you are asking about?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!