Forum Discussion
Change values on visuals using a list/dropdown
- 6 years ago
Hmmm, yes you should be able to create a disconnected table. Has to not be connected to anything else, no relationships. It might be called 'MyDisconnectedTable' and have an Item column with values of
bunny
fluffy
poo
You should then be able to write a measure like this:
Measure =
VAR __selected = SELECTEDVALUE('MyDisconnectedTable'[Item])
RETURN
SWITCH(__selected,
"bunny",SUM('Table'[Commission]),
"fluffy",SUM('Table'[Revenue]),
"poo",SUM('Table'[Cost]),
BLANK()
)
Not sure why you would not be able to get HASONEVALUE or SELECTEDVALUE to work. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
If you need additional examples: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563
Hmmm, yes you should be able to create a disconnected table. Has to not be connected to anything else, no relationships. It might be called 'MyDisconnectedTable' and have an Item column with values of
bunny
fluffy
poo
You should then be able to write a measure like this:
Measure =
VAR __selected = SELECTEDVALUE('MyDisconnectedTable'[Item])
RETURN
SWITCH(__selected,
"bunny",SUM('Table'[Commission]),
"fluffy",SUM('Table'[Revenue]),
"poo",SUM('Table'[Cost]),
BLANK()
)
Not sure why you would not be able to get HASONEVALUE or SELECTEDVALUE to work. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
If you need additional examples: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563