Forum Discussion
Create table with what-if parameters
- 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 )
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.
Nathaniel
Value 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 )
- John1174 years agoNew Member
Hello Nathaniel!
It works, thank you so much!- Nathaniel_C4 years ago
Community Champion
Thank you John117 , it is an interesting problem!
- Nathaniel_C4 years ago
Community Champion
Hi 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- johnChu3 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