Long story short: if you are building an SSRS report in Microsoft BI studio, and if that report has parameters, you cannot customize the automatically generated MDX query.
If you switch to text mode, make a change (any change, e.g. adding a space) and hit “save”, you get this error:
An MDX expression was expected. An empty expression was specified.
The culprit is this subquery added by the Query Designer:
SELECT ... FROM
( SELECT ( STRTOSET(@parameter, CONSTRAINED) ) ON COLUMNS FROM [data source]) WHERE ...
The problem is explained in more detail in this thread on MSDN forum.
The responder there claims that this is not automatically generated code, but in fact it is. Apparently, someone fiddled with the MDX query generator at the last moment. If you remove the subquery and replace it with just
[data source], customization works like a charm.
Admittedly, we are using an outdated version of the BI studio (2008), but still, this is not cool. And the error message is not that helpful either.