Forum Discussion
EvaHello
10 months agoHelper I
If OR statement - what am i doing wrong?
Hi all, I am trying to write a column formula to say if the metric is labelled 'percentage', then format the absolute difference as "-", and if its any % eg gross margin, the variance calculation...
- 10 months ago
pls see if this works for you
% Variance FC vs PY =
VAR MetricType = SELECTEDVALUE('Results (2)'[Period])
VAR FC = SELECTEDVALUE('Results (2)'[MTD FC])
VAR PY = SELECTEDVALUE('Results (2)'[MTD PY])
RETURN
IF(
OR(MetricType = "Percentage", MetricType = "Ratio"),
"-",
FORMAT(DIVIDE(FC - PY, PY), "0%;(0%)")
)if this does not work, pls provide some sample data and expected output.
ryan_mayu
10 months agoSuper User
pls see if this works for you
% Variance FC vs PY =
VAR MetricType = SELECTEDVALUE('Results (2)'[Period])
VAR FC = SELECTEDVALUE('Results (2)'[MTD FC])
VAR PY = SELECTEDVALUE('Results (2)'[MTD PY])
RETURN
IF(
OR(MetricType = "Percentage", MetricType = "Ratio"),
"-",
FORMAT(DIVIDE(FC - PY, PY), "0%;(0%)")
)
if this does not work, pls provide some sample data and expected output.