How to add a Metric control to choose between Units or Percentage?

ifelse statemts don’t allow aggregates so my calculated field that I want to use in a parameter doesn’t work.

This is what I have now:

ifelse(${Metric}=“units”, {units}
, ${Metric}=“Percentage”, {percentage}
, {units}

Where percentage is:

Does anyone have any workaround?

Try this



1 Like

Gives me the following error:
Expression in(“units”,${Metric}) for function in has incorrect argument type in(String, String). Function syntax expects ‘in(<COMPARABLE_TYPE>, <COMPARABLE_TYPE>)’

Can you paste your calculation.


Hi @Manuel_Garcia

Is your parameter multiple values? If not go back to your first calculation and add an aggregation to units.

ifelse(${Metric}=“Percentage”, {percentage}
, sum({units})
1 Like