I want to create a the following measure using if statement:
PRE_MTD_M_visit_cost_v2 =
if('table_1'[Source_Type]="Online";
CALCULATE((DIVIDE(21*[MTD_M_visit_cost];7)));
'table_1'[M_visit_cost])
I want to create a measure with a conditional statement if column Source_Type
has “Online” then I want to calculate MTD_M_visit_cost
based on the number of passed working days in April (which has 21 working days).
If column Source_Type has another text value, I want to return M_visit_cost
measure (which I already have created).
PBI returns the following error:
It is impossible to define one value for the "Source_Type" column in the "roistat-analytics-data" table. This can happen if, for a single result, a measure formula refers to a column containing a set of values, without specifying an aggregate, for example MIN, MAX, COUNT, or SUM.
I know that I can create a conditional column, but ideally, it would be great to be able to create a measure. Any help is appreciated.