Dear Experts,

we have values for engery consumption, wich are metered. In order to keep timelines useable in case of errors in metering, there are substitute values.
There is a dimension [Quality of data], containing leaf elements [metered] and [substitute].

I am looking for a solution to calculate a further element [base], wich represants the substitute if there is any, otherwise the metered value.
This simple calculation doesn't work out for aggregations:
SCOPE ([quality of data].[Base])
THIS = IIF([Quality of data].[Substitute]>0;[Quality of data].[Substitute];[Quality of data].[Metered])
END SCOPE;

mdxBase.PNG

I would strongly prefer a solution of this kind. Is there any way to make it?

Thanks in advance for any hint.

Bests
Matze