To answer your second question: You would create two measures, and if you create Offers value
first and position Efficiency
after it in the calculation script, then you can just use the first one in the second.
You cannot use WITH
in the calculation script, but only in SELECT
statements. That is probably the reason why you get an error message (your first question).
Any your measure definition should probably look something like
CREATE MEMBER CURRENTCUBE.[Measures].[Efficiency]
AS
IIF([Measures].[Offers Value]=0, 0
, 1 - ([Measures].[Offers value], [Is Ordered].[Is Ordered - Status].&[0])
/ ([Measures].[Offers Value]))
,FORMAT_STRING="PERCENT",
, VISIBLE = 1;
just leaving away the WITH ... AS
. You were close to it!