I have a task to convert existing MDX measures (from multidimensional model) into DAX (tabular model). During this task I found that in DAX there is no functionality to use "CREATE MEMBER" option as it was in MDX. But I have some members created inside this cube by this function (not in DWH). In this case I'm trying to figure out how to do the same (equivalent) in tabular model (DAX)
There is a part of code which I'm replacing right now:
CREATE MEMBER CURRENTCUBE.[Condition].[Condition].[All].[NEW+USED]
AS [Condition].[Condition Type].[NEW]+[Condition].[Condition Type].[USED]
Image:
There is an example of [Condition] table from DWH:
I have an idea to create a VIEW based on this table with UNION to add a new row "NEW+USED" inside this VIEW and than use SWITCH inside cube (DAX function) for ALL measures
For example:
NVC:=
VAR GALC = [ABC] + [CDE]
RETURN SWITCH(
SELECTEDVALUE('Condition'[ConditionTotal]);
"ConditionTotal"; GALC;
"NEW+USED"; CALCULATE(
GALC;
FILTER(ALL('Condition'[ConditionDescription]); 'Condition'[ConditionDescription] = "New" && 'Condition'[ConditionDescription] = "Used")
)
)
But I'm not sure if it is correct way or not because in this case I should populate all columns from table and some of them using in relationships to Fact tables inside cube.