Forum Discussion
SWITCH function to use images in Slicer
Hello.
I am trying to use the SWITCH function to replace text for images in a Slicer but for some reason it's not working. The image URLs are fine, I think it may be because the table has active relationships with other tables but not sure how to combat this.
I can't use a Chiclet slicer because this does not sync across the whole report.
Any help would be appreciated, thanks!
8 Replies
- v-piga-msft
Resident Rockstar
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
- AnonymousNot applicable
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..
- hcdeconRegular 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.
- hcdeconRegular Visitor
Hi v-piga-msft thanks for the response.
I removed the comma but then the error message "DAX comparison operations do not support comparing values of type Text with values of type Number. Consider using the VALUE or FORMAT function to convert one of the values." came up? The expressions (18-35 etc) are categories of ages.