Forum Discussion
Use selectedvalue from slicer in a visual with no interaction
Is there a way to get the selectedvalue() from a slicer that has interactions turned off, from the visaul that I'm trying to use the measure on?
var A = CALCULATE([ParetoRank], Dim_Machine[Name] = "A", all(Dim_Machine_Comp[Name]))
parry2k, I think I have solved my problem with another solution.
I kept the interaction but used removefilters() on the measures that I have in the visual.
But thanks for helping 🙂
5 Replies
- parry2k
Super User
AnnaMagnusson well, in this case, create a disconnected table and then use a column from that table in the slicer, in that case, you will be able to get the selectedvalue from the slicer.
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- AnnaMagnusson
Helper I
You mean add a slicer from another table, that looks exactly like dim_machine, but doesn't have a relation and use
var selM = selectedvalue(machine[Name])
and thenreturnSWITCH( TRUE(),selM = "A", 1,selM = "B", 2)because I've tried that but still not workning...
- parry2k
Super User
AnnaMagnusson yes exactly and it should work. Share pbix file and remove sensitive information before sharing.
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- AnnaMagnusson
Helper I
parry2k , unfortunaly I can't share some pbix since alot of the information is sensitive even if I remove most of it. Sorry if that makes it harder/impossible to solve.
But when I use a disconnected table as a slicer I still get blank, so it think that I have not selected anything, and just use the default blank option. Other things that I have tried to use is
contains(dim_machine, dim_machine[name], "A"), A,contains(dim_machine, dim_machine[name], "B"), B
within the switch but it just use the first line so only works when "A" is selected in the slicer is that is on the first line. And now I'm looking at keeping the interaction but use removefilter() somehow.
- AnnaMagnusson
Helper I
parry2k, I think I have solved my problem with another solution.
I kept the interaction but used removefilters() on the measures that I have in the visual.
But thanks for helping 🙂