Seeing is Believing
The old adage says that a picture is worth a thousand words. But we're so used to seeing photographs that it's easy to forget that photography itself is not even two hundred years old. Digital photography is even newer. Kodak labs first developed a digital camera in 1975, and it wasn't until the early 1990s that these cameras became commercially available.
Image File Formats
Even though I work with data just about every day, I still sometimes even forget that digital images are actually data that computer code translates along the way so it can interpret them. It's also easy to forget how much space images take up in storage folders (especially for high-quality images). For storing these images, there are a number of different image file formats we can use.
The storage type I use for the image depends on what I'm using it for. Here are a few examples of my own most common scenarios.
Image Data in Power BI
Some of my favorite hidden tricks in Power BI are the capabilities it has to work with image data. And there are many ways in which we can use these images. When I set out to create the Power BI Weekly series, my goal was to share really neat tricks hidden in plain sight within Power BI that I wish I'd known earlier myself. Within Power BI, we can use images for the organization's logos on our reports and dashboards, as data points in visuals, and in image recognition algorithms. I used the fictional kinetECO company website and the images on it for several of these examples!
Image Recognition
Last year, I created a course for LinkedIn Learning that focused on how to use AI and machine learning algorithms directly in Power BI without having to write any code ourselves. I had so much fun creating this course. I especially loved the Power BI Dataset I used to show how these functionalities and features worked. This includes a set of images that I ran the Azure Cognitive Services image recognition model - officially named the Vision algorithm - on within the Power Query Editor before loading the data into Power BI.
While it does require a Premium subscription, it also works with the Premium per user option (!!) for connecting to Azure Cognitive Services to run in the cloud. If there was a case for getting cloud accounts for Power BI and the rest of your data, this is it!
This algorithm works by running the model behind the scenes to identify the objects in our images. Here are a few examples. Let's say we have images containing wind turbines. The Vision algorithm can recognize these objects within the images, and it then lists that and any other objects (people, trees, plus many others) in the results as well. One caveat to this model is that it can take a lot of time to run because it does involve a lot of processing, even for just a few images. It's not designed for immediate recognition, but rather it can work over a large dataset when we give it a lot of time to run.
In Tables and Slicers
If we want to import an image (like a company logo) directly to our Power BI model, we can import it through the insert options. However, this means the image is just a graphic in our model and not a data point. What if we want to use images as data points in our Power BI model? Here's what this looks like on a high level. Notice how the image gets converted into bitmap text in the Power Query Editor. Once we load the data into Power BI, we can then specify it as an image URL category to actually use in visuals.
领英推荐
In the latest video of my Power BI Weekly series, here's how we do this for images that we want to use in visuals like tables and matrices. We follow the same import process illustrated above. I personally feel it's actually much more straightforward than it looks, even in the diagram! Make sure that you specify the image file format (*.jpg or *.png) that you're using so that the images properly load!
We can also use these image data points in other visuals, like slicers! One example of a slicer that supports these images is the Chiclet slicer. It's available in the Microsoft AppSource store under the Power BI visual options we can download into our own models. As always, use caution with some of these custom visuals! This one is Power BI certified though through Microsoft and one of my favorite slicer visual options to explore using in different projects.
In addition to the energy company images, there are many other images we can use in our Power BI models as well. I've used country flags as images within Power BI visuals. Check out these flags on my GitHub page, where you can download them yourself. There's also already the proper size for uploading into Power BI so you don't need to resize them first!
A Few More Notes
And finally, here are a few more updates and notes on my content and a few others things as well!
Updated Advanced Microsoft Power BI Course
The updated version of my first-ever LinkedIn Learning course - Advanced Microsoft Power BI - is now available in the library using a more recent view of the Power BI interface. It still covers much of the same DAX concepts that the original course did, including using the loan calculation model as the course project.
Back to the Jackalope
If you're wondering about the jackalope in this article's cover image, I'm still learning a lot about it too. I was recently at a specialty meat shop with my mom, picking up KC bacon and turkey/bison jerky. We're at the register when I look up and see there's a mounted rabbit with antlers (see the cover photo) just above eye level on the wall. They told me it was a jackalope. Not really knowing what to think or say, I nodded my head, and we promptly left the store.
Of course, I looked up the term jackalope later that evening, and here's what I learned, courtesy of a podcast episode from 99 Percent Invisible! It's not actually an animal, but rather a myth that's fooled more people than who would care to admit it.
Thanks for reading this newsletter! Stay tuned for future editions focusing on the topics covered in the Power BI Weekly series and much more!
-HW