Variable group selections for ratio calculations

I have a need to display a ratio for two groups of names. First group is a single selection of one name and showing the calculated impact ratio (impacted divided by total). Second group is a multi-selection of other names and showing the calculated impact ratio (sum of impacted divided by sum of total).

I created two filter cards on the dashboard that only impact the bar chart but not each other. One to select the first group and another to select the second group.

First Group Ratio: sum(impacted) / sum(total) FIXED (BY category FILTER ALLOW Name)

Second Group Ratio: sum(impacted) / sum(total) FIXED (BY category FILTER DENY Name)

Sample dataset below with expected result calculations for validation:

The fixed by functions don't return the expected results in a grouped bar chart with the two ratios. Eg. selecting name = A for the first group and all 3 names for the second group returns 10% for impacted ratio of first group which is correct. But the group 2 ratio comes back as 3% rather than 38%.

I thought it might have to do with a lack of the additional sum function around the fixed by but that fails the beast mode validation.

sum(sum(impacted) / sum(total) FIXED (BY category FILTER DENY Name))

Comments

  • I since discovered this prior thread with a similar challenge. The difference being the simpler aggregation that doesn't contain embedded calculations for the ratios. https://community-forums.domo.com/main/discussion/56246/compare-two-peer-groups

  • Found a lead here to avoid the syntax error from the fixed function containing division.

    https://community-forums.domo.com/main/discussion/67010/nested-fixed-functions