MDX / Excel CUBEMEMBER() with condition on other table

Viewed 128

I'd like to select a string value from column [foo] where the condition of [bar] is true. The "cube" is actually a Power BI model which i'm trying to select more dynamically with cube functions because a pivot table isn't suitable for all requirements. Both tables have a simple n:1 relationship and playerid is the key.

tbl_1.[playerid], tbl_1.[foo]

tbl_2.[playerid], tbl_2.[bar]

Dynamic value for the condition comes from excel cell A1 in this mockup.

This is what i'm trying to do but i can't figure out the syntax and google does not offer many references (feel free to link anything that could help because i can't seem to find anything).

=CUBEMEMBER("myModel";"[tbl_1].[foo].&[tbl_2].[bar].["& A1 &"]")

I would be delighted to have a solution which would accept more than 1 condition.

I also tried to go from "convert to formulas" button in Excel -> Pivot Table -> OLAP-Tools but this hardcodes the condition and puts curly braces around it, so no cell reference is possible. If someone could explain the curly braces syntax, that would be nice too. Thanks.

=CUBEELEMENT("myModel";{"[tbl_2].[bar].&[playerid]"."[tbl_1].[foo].&[HardcodedValueImTryingToGet]"})
0 Answers
Related