Get the Image URL in Power BI Using Power Query Get Table from Example

I have written previously a blog article that I explained in detail how I fetch the image URL from a website using Power Query. That method, however, is what I call a bit of a techie way of doing it because you have to look at the HTML code of the page. There is an easier way of doing it as well. For this method, you don’t need to look at the code at all. I am going to explain it in this post. If you like to learn more about Power BI, read Power BI book from Rookie to Rock Star.

Get Data from Web

In Power BI (Power Query), when you get data from web, you get a list of tables suggested by the graphical interface of Power Query. However, those tables, usually cover the data, not link URLs, or image URLs. the below example, is what I get when I use Get Data from Web of this URL for IMDB top 250 movies: https://www.imdb.com/chart/top

Add Table Using Examples

If you click on Add table using examples button (mentioned in the screenshot above), You will get a graphical editor, that you can enter some sample values, and tell to Power Query what is the value you are looking for, then Power Query will search for those values in the page, and use that structure as a template.

The Add table using examples is particularly good when the data you want to fetch from the page is not in an HTML table, The example below, shows that I get data even from part of the page that is not a table. With just providing the first two values of any list, as an example, Power Query will find the structure to locate the section and get the remaining values;

Image URLs

The same method can be used for Image URLs. First, you need to get a couple of Image URLs as an example. If you use Google Chrome as a browser, on the right click on an image, you can get the option for it; Copy image address

Now in the Add table using examples, paste that value in the first cell;

Do this process one more time for the second image in the list,

Easy, wasn’t it? now you got all the image URLs!

You can also add the other information for each movie, so you can find out what movie’s image it is. You can also rename columns to whatever you like, and then load that data into Power BI.

Now these image URLs, can be loaded into Power BI, with the Data Category as image,

and you can have a visual like this:

What if this method doesn’t work?

There is a possibility that this method doesn’t work. Depends on the complexity of HTML code, and even sometimes similarity of blocks and values on the page, this method might not give you exactly what you want. If you cannot get this method to work, I strongly recommend you to do it using the other method I explained in my other article.

I hope this quick tip helps you to get the image URLs that you want even much simpler and faster, using Power Query.

Video

Reza Rad on FacebookReza Rad on LinkedinReza Rad on TwitterReza Rad on Youtube
Reza Rad
Trainer, Consultant, Mentor
Reza Rad is a Microsoft Regional Director, an Author, Trainer, Speaker and Consultant. He has a BSc in Computer engineering; he has more than 20 years’ experience in data analysis, BI, databases, programming, and development mostly on Microsoft technologies. He is a Microsoft Data Platform MVP for 12 continuous years (from 2011 till now) for his dedication in Microsoft BI. Reza is an active blogger and co-founder of RADACAD. Reza is also co-founder and co-organizer of Difinity conference in New Zealand, Power BI Summit, and Data Insight Summit.
Reza is author of more than 14 books on Microsoft Business Intelligence, most of these books are published under Power BI category. Among these are books such as Power BI DAX Simplified, Pro Power BI Architecture, Power BI from Rookie to Rock Star, Power Query books series, Row-Level Security in Power BI and etc.
He is an International Speaker in Microsoft Ignite, Microsoft Business Applications Summit, Data Insight Summit, PASS Summit, SQL Saturday and SQL user groups. And He is a Microsoft Certified Trainer.
Reza’s passion is to help you find the best data solution, he is Data enthusiast.
His articles on different aspects of technologies, especially on MS BI, can be found on his blog: https://radacad.com/blog.

Leave a Reply