Forum Discussion
Create table with what-if parameters
Hello!
I'm trying to create a dynamic table with DAX functions where one of the columns shows the value that user input in the what-if parameter. For example if the user enter these values for what-if parameters:
My table should shows:
I'm tryng to use this DAX function to create the table, but it don't work (the error message is: too many arguments were passed to the SELECTEDMEASURE function. The maximum argument count fot the function is 0):
Any suggestion?
Thank you so much!
Hi John117
Try this:
- Create a table with one column with the Value names
- Create the measure below
I used an IF() but use a SWITCH () if there are more values.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
NathanielValue table = VAR _curValue1 = 'Value 1'[Value 1 Value] VAR _curTableValue = MAX ( newtable[Value] ) VAR _curValue2 = 'Value 2'[Value 2 Value] RETURN IF ( _curTableValue = "Value 1", _curValue1, _curValue2 )
6 Replies
- Nathaniel_C
Community Champion
Hi John117
Try this:
- Create a table with one column with the Value names
- Create the measure below
I used an IF() but use a SWITCH () if there are more values.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
NathanielValue table = VAR _curValue1 = 'Value 1'[Value 1 Value] VAR _curTableValue = MAX ( newtable[Value] ) VAR _curValue2 = 'Value 2'[Value 2 Value] RETURN IF ( _curTableValue = "Value 1", _curValue1, _curValue2 )- John117New Member
Hello Nathaniel!
It works, thank you so much!- Nathaniel_C
Community Champion
Thank you John117 , it is an interesting problem!
- Nathaniel_C
Community Champion
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πare nice too.
Nathaniel