Forum Discussion
John117
4 years agoNew Member
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 wh...
- 4 years ago
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 )
Nathaniel_C
Community Champion
4 years agoHi John117 ,
BTW here is my pbix if you might be able to use it.
https://1drv.ms/u/s!AgCd7AyfqZtE3z_A6wH2EyvfloHC?e=x3JuXX
Thanks again,
Nathaniel
johnChu
3 years agoNew Member
Hi Nathaniel_C,
I found this is interesting for learning what if parameter. But if there are three or more what if parameters, how could we retrieve the current value, that is, how to modify _curTableValue statement? If we still use MAX, it always returns the biggest value (value 3 if 3 what if parameter).
thanks