Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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!
Solved! Go to Solution.
Hi @John117
Try this:
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 )
Proud to be a Super User!
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
Proud to be a Super User!
Hi @John117
Try this:
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 )
Proud to be a Super User!
Hello Nathaniel!
It works, thank you so much!
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
Proud to be a Super User!
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
Thank you @John117 , it is an interesting problem!
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |