Forum Discussion
Dynamic parameter - DAX
- Anonymous1 year ago
Thanks DataNinja,
unfortunatly this solution is not working. With DACH Area role and value owner selecting, I still do not get the breakdown by area.
I have found a different solution. See below:
I added the "Area" dimension to the parameter as number 4.
I have then a middle table between roles and parameter that, based on the role, filter the second table that contains the parameter value (all the roles have values 0,1,2,3 while "DACH Area" have 1,2,3,4.
The middle table is then connected to the parameter via a multi-one relation with filter direction bidirectional, so that I can filter the parameter from the middle table.
Final results below:
Hi Anonymous - can you below approach:
Dynamic_Dimension =
VAR SelectedRole = SELECTEDVALUE(RolesTable[Role])
VAR IsDACH = SelectedRole = "DACH Area"
VAR SelectedParameter = SELECTEDVALUE(ParameterTable[Dimension])
RETURN
SWITCH(
SelectedParameter,
"Owner", IF(IsDACH, SELECTEDVALUE('Opp Details'[Area]), SELECTEDVALUE('Opp Details'[Opportunity Owner])),
"TCV € Class", SELECTEDVALUE('Opp Details'[TCV € Class]),
"Prob. Class", SELECTEDVALUE('Opp Details'[Prob. Class]),
"Prev.Stage", SELECTEDVALUE('Opp Details'[Prev.Stage]),
"Area", SELECTEDVALUE('Opp Details'[Area])
)
since you want the displayed dimension to change dynamically based on the selection in the Role filter, a DAX measure.
Hope this helps.