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.
EvaHello
10 months agoHelper I
Just to add on to this - id like to factor into my formula that if its a cost and it goes up, the variance should be negative. At present, its a blanket variance where its positive wherever anything goes up (revenue, costs etc). Could anyone help alter this for me?