Forum Discussion
Nested IF statement?
Thanks, Amira! I think my base64 code is around 90,000 characters, though. Is it still appropriate to put it in this function?
It is possible but the recommendation is to use smaller Base64 codes in DAX functions whenever possible
- bonjourposte3 years ago
Helper V
Hi, I tried your code, but instead of the 90,000 characters of Base 64, I just wrote the name of the picture in the folder. It didn't like that- how would you reference the image if not by the code or the title?
Image =var img =IF(HASONEVALUE('City Images JPG Base 64'[Name]),"data:image/jpg;base64, " &CONCATENATEX('City Images JPG Base 64','City Images JPG Base 64'[Pic],"","data: image/jpg;base64, " &'City Images JPG Base 64'[INDEX],ASC),IF(COUNTROWS('City Images JPG Base 64')=0|| ISBLANK('City Images JPG Base 64'[Pic]),"data: image/jpg;base64,AA Canada generic","data: image/jpg;base64, " &CONCATENATEX('City Images JPG Base 64','City Images JPG Base 64'[Pic],"",'City Images JPG Base 64'[INDEX],ASC)))RETURN img- bonjourposte3 years ago
Helper V
So I fiddled with this some more and found some more documentation from Dapper Dash and combined it a bit with your suggestion- I added a measure to my "City Images JPG Base 64" data set that checks to see if a filter has been applied. Then I added the code at the beginning (box 1) for instances when nothing is selected. It works.
But then I added an else clause at the end for images that don't have a picture (box 2) and it's not returning the default image. Suggestions?
- AmiraBedh3 years ago
Super User
Can you share your pbix file ?