Forum Discussion
SELECTEDVALUE doesn't work in a measure table
You can’t refer to a slicer in a dax formula for a calculated table.
MattAllington wrote:You can’t refer to a slicer in a dax formula for a calculated table.
Hi MattAllington,
Why can't refer to a slicer for a calculated table? Is this a bug of Power BI?
- MattAllington7 years agoCommunity Champion
No it is not a bug. Tables and columns are considers static parts of he data model and do not update based on slicer interaction.
- Hawk_Wang7 years agoRegular Visitor
Hi MattAllington,
Thank you for your reply.
There is a mistake in my previous description. The real issue is that the SELECTEDVALUE can't work in IF function, the return value of it always is the default.
My SELECTEDVALUE formula is as following:tempVal = SELECTEDVALUE(t_stream_type[type], "Cloud")
And the IF formula is as following:
multiplier = IF([tempVal] ="Cloud", 1, 2)
And the slicer 'Stream' has three options as the following picture:
The issue is no mater what I selected in the slicer, the value of multiplier always equal to '1'.
Could you help me ?- MattAllington7 years agoCommunity Champion
How does the column t_stream_type[type] relate to the slicers in your image. It is not clear.
- Hawk_Wang7 years agoRegular Visitor
And now I use the same formula as multiplier to create a new measure multiplier2 in a normal data table( not calculated table) , the formula is as following:
multipler2 = IF([tempVal] = "Cloud", 1, 2)then multiper2 works well. It's why?
- MattAllington7 years agoCommunity Champion
There is not enough information to help you here. You don’t say which table is the calculated table, if the column in the slicer is in that calculated table or another table. If any of these tables are joined and if so which Direction the relationships are etc. All this Information is relevant.