I have made use of the Case function in Data Studio to ascertain whether a value is over or under £6,000 and present one of two figures dependent on output. These two figures are calculated fields.
First Case statement :
(Over or Under) -
CASE WHEN Cost <= 6000
THEN 1
ELSE 0
END
Second Case statement -
(Total Cost) -
CASE WHEN Over or Under 6,000= 0
THEN Cost if over 6,000
ELSE Cost if under 6,000
END
Cost if over 6,000 is calculated in the following way -
Cost + (Cost * .1)
and Cost if under 6,000 is calculated -
Cost + 600
This is working perfectly on one report, but when I replicate it in another report with identical data I get the following error message -
An expression can have either metrics, or dimensions, but not both
All calculated fields are defined as numbers so why am I getting this error message? And why would it work in one report and not another?