Forum Discussion
SWITCH function to use images in Slicer
Hi hcdecon,
From the screenshot, it seems that you have some mistakes for the switch formula which I highlight in red.
Please modify your formula and try again.
If you still need help, could you please share a dummy pbix file which can reproduce the scenario, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)
Best Regards,
Cherry
Adding to v-piga-msft response, a switch statement also needs an 'other' value. Effectively this is what the switch statement needs to do if all of the conditions fail. so rather than remove the Comma as has been suggested, you need an image url to show if none of the above conditions are satisfied..
- hcdecon8 years agoRegular Visitor
Hi Anonymous thanks for the response.
Sorry I'm quite new to this, how do I add the 'other' value to show if none of the above conditions are satisfied? I couldn't find the answer online.
- Anonymous8 years agoNot applicable
Switch Statements are normally written like this:
SWITCH( "Compare to me", "Are you 6?", "This is the answer", "Are you 7?", "That is the answer", "Are you more than 7?", "Answer this way", "Instead answer like this" )
Or sometimes in a format more like this
SWITCH( TRUE, 6 = 'Table'[Field], "This is the answer", 7 = 'Table'[Field], "That is the answer", 'Table'[Field] > 7, "Answer this way", "Instead answer like this" )
Hopefully this illustrates it better for you
- v-piga-msft8 years ago
Resident Rockstar
Hi hcdecon,
Have you solved your problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please feel free to ask.
Best Regagrds,
Cherry
- hcdecon8 years agoRegular Visitor
Hi Cherry,
That problem is solved - I just created a seperate column for ID and used that instead. However, the actual image won't show up on the filter, just the image URL. I have tried several URLS with the same result. Here is a link to a dummy version of the file: https://app.box.com/s/eouqtyk37ipoainxg6xoyms2q9ybff15
Thanks, any help would be appreciated.