cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dz6kb4
Frequent Visitor

Dynamic sets of images based on filter

Hi all.

 

i couldn't find an exact answer to my question on the search. I'm basically looking for a way to dynamically display a range of images depending on a filter selected.

 

for example, if I have a report on foods I might have a food filter including meat, fish, veg.

 

when I select meat I want to show an image of chicken, pork and beef with a total calorie per 100g under each one.

if I then select fish I want to dynamically remove the meat images and replace with tuna and salmon images and their associated calorie counts.

 

is this at all possible?

many thanks.

2 ACCEPTED SOLUTIONS
Vvelarde
Community Champion
Community Champion

Hi @Dz6kb4,

Yes. Based on Vvelarde's sample data, you would need to have one of the amount eaten records in table for each month of the year as shown in the following screenshot.
4.PNG

However, to better manage your tables, I would recommend you separate the Food table to two tables,  then create relationship between the two tables using type field. For more details, please review the modified PBIX file.
1.PNG2.PNG

 


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

17 REPLIES 17
aditya_fractal
Advocate I
Advocate I

Hi all,

 

The solution proposed is working perfectly. However, just wanted to know if there is any way to avoid the ImageURL. For example: what can we do if the images are not available on the internet.

 

Thank you!

One of the solutions I found is to convert the image into Base64, store it in my model & use it from there.

If anyone comes across a better way of doing this, I would request you to share it with all of use here.

 

Thank you!

smsantos31
New Member

Hello!

I followed the instructions but I cannot display the image, and when I tried downloading the pbix file with the DEMO, the same happens. Could it be a restriction of the local network?

Thanks!

 Check my screenshot here: SCREENSHOT, I couldn't upload the image. 

 

SS

Hi,

 

The same thing has happened to me with regards to the images not being displayed correctly. Did you manage to resolve this? I have tried uploading the URLs in an Excel data table and also typed manually directly into PBI - neither have worked.

 

Would be grateful for a response.

 

Aki

lu_vynn
Regular Visitor

Hi,

Have you put your URL data as Image URL? In the Modeling tab:

 

smsantos31
New Member

Hello!

I followed the instructions but I cannot display the image, and when I tried downloading the pbix file with the DEMO, the same happens. Could it be a restriction of the local network?

Thanks!

 Check my screenshot here: SCREENSHOT, I couldn't upload the image. 

 

SS

Hi,

 

The same thing has happened to me with the image not being displayed. I've tried uploading an Excel sheet with URLs and also typed the data directly in Power BI.

 

Did you find a solution?

Vvelarde
Community Champion
Community Champion

What if the image I want to display is a screenshot form my PC, and does not have a URL?

@Pakinam You can convert any image you want to use inside POWER BI into base64 format using any of the websites available & use the generated base64 string.

 

Hope it helps!

Dz6kb4
Frequent Visitor

Wow, brilliant, had now idea you could do that, thanks alot.

 

I forgot to add an extra level of complexity however - if I replaced calories with amount eaten and that amount eaten changes depending on the month, would I be able to use this technique still?  I.e if I select Jan and meat - have all the meat images and just the jan amount eatens shown?

Many thanks

Dz6kb4
Frequent Visitor

@Vvelarde if you can help pls? 🙂

Vvelarde
Community Champion
Community Champion

@Dz6kb4

 

Yes, still work. Just add a slicer with the months.

 

 




Lima - Peru
Dz6kb4
Frequent Visitor

@Vvelarde thanks again.  But presumably I will need to have one of the records in your table for each month of the year if I want to change the values and images  by month?  Just wondering if there is a better way to do this?

 

Many thanks.

Hi @Dz6kb4,

Yes. Based on Vvelarde's sample data, you would need to have one of the amount eaten records in table for each month of the year as shown in the following screenshot.
4.PNG

However, to better manage your tables, I would recommend you separate the Food table to two tables,  then create relationship between the two tables using type field. For more details, please review the modified PBIX file.
1.PNG2.PNG

 


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Excellent, thanks very much both

Hi @Dz6kb4,

You can accept multiple helpful replies as answer, this way, other community members would easily find the answer.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors