Forum Discussion
New Slicer - Dynamic image based on selection
Hi,
I am trying to use the new slicer to create a hierarchical navigation, where the selection of an element on the top level reveals the next. This works perfectly so far with a custom DAX measure using IF and ISFILTERED.
I would also like to "invert" the colour of the element selected. For the background this already works well, but I cannot invert an image. The settings menu for images is restricted; you can only have a measure in Default, but nowhere else. This is why I have tried to create a custom measure that would switch the relevant parts in the URL with SUBSTITUTE:
If(
SELECTEDVALUE('Register'[HierarchyLevel])=2
,IF(
ISFILTERED('Register'[Lvl1])
&& SELECTEDVALUE('Register'[Lvl2])<>BLANK()
,SUBSTITUTE(
SELECTEDVALUE('Register'[IconLink])
,"Grey"
,"White"
)
,SELECTEDVALUE('Register'[IconLink])
)
)
As you can see, I have tried to check the filter context of the slicer with SELECTEDVALUE <> BLANK(), but this does not work.
How can you check the filter context within the slicer?
Thanks for your help!
- Anonymous2 years ago
Hi, spmsmf
Actually, the feature you want is not available in the current version of Power BI, isfilter function is a filter in Slicer.Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
5 Replies
- AnonymousNot applicable
Hi, spmsmf
According to your description, the SELECTEDVALUE <> BLANK() you wrote doesn't work as a filter, you could tryNOT ISBLANK(SELECTEDVALUE('Register'[Lv1]))If it does not work, you can share pbix files without sensitive data, datasheets and other information for testing purposes.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- spmsmfFrequent Visitor
Hi Anonymous,
thanks for helping me out.
Your solution unfortunately did not work.
Here is a test report. I hope everything is layed out clear enough.
- AnonymousNot applicable
Hi, spmsmf
Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.Measure:
slicer image = [Selected]Swap image = VAR _column2 = SELECTEDVALUE ( 'Table 2'[Column2] ) RETURN IF ( ISFILTERED ( 'Table 2'[Column2] ) && ( SELECTEDVALUE ( 'Table'[Column1] ) = _column2 ), [Selected], [Deselected] )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- spmsmfFrequent Visitor
Hi Anonymous
Thank you for your help.
This looks promising, but what I would need is these dynamic items within the new slicer. I tried your measures, but they do not work as intended (if selected, then green icon, else red icon).
Is this possible?