Unlock Weather Insights: How You Can Use Power BI with OpenWeatherMap — Part 12

Andrew Hubbard
Microsoft Power BI
Published in
5 min readApr 10, 2024
Sample image from the weather dashboard we will create. Background image in dashboard Photo by Tim Foster on Unsplash

In the last part of this series, we started creating the Current Weather information panel. In this part, we will add the various weather values to the report. For this report, we will use icons from uxwing which is a collection of free icons you can download for commercial projects without attribution. I will provide the links to the icons that you can use if you wish. When we add the images, we will use buttons to show the image instead of using images as we can use svg files in buttons. Using svg files will allow us to scale the images if needed without distortion.

I have provided the icons used in this dashboard that you can download from if you wish. The link is here: Weather Dashboards Icons. Explore the uxwing site as you might see icons you would prefer to use.

We will add the current weather icon, which will use the calculated column we added in the last article.

Adding Current Weather Icon

  • Add the Simple Image visual to the report by opening the insert menu from the toolbar.
  • Click the down arrow next to the visuals box to expand the list of visuals.
  • Navigate to the bottom of the list. The simple image visual should be the last visual in the list just above the get more visuals option.
Lower part of the Power BI Visuals List Showing the Simple Image visual icon just above the Get more visuals option.
  • Click on the Simple Image icon to add it to the canvas.
  • The Simple Image icon data options will appear, click on + Add Data and navigate to the weather image url column in the Current Weather table.
  • Now click the format button, at the far right-hand side of the Power BI Desktop window.
  • Expand the size and style option on the visual tab in the format pane.
  • We will now set the height, width, and position of the rectangle.
  • Change the height in the Size and position options from the current value of 300 to 50 by clicking in the height box and entering the new value.
  • Change the width in the Size and position options from the current value of 300 to 50 by clicking in the width box and entering the new value.
  • Change the horizontal position in the Size and position options from the current value of 100 to 50 by clicking in the horizontal box and entering the new value.
  • Now change the vertical position in the Size and position options from the current value of 100 to 190 by clicking in the vertical box and entering the new value.
  • If the Background is showing on. The turn off the Background to the image by clicking on the Background toggle button to turn it off.

This has added the weather icon to the dashboard, we will now add the weather description. There are two methods we could use to do this. The first method is to add a card to the visual and format it. The second method is to use a text box and use the value option in the text box to add the value from the current weather table. This is like using a smart narrative. We will use the text box method as it is a method I enjoy using. I find it more flexible than the card method for creating narrative.

Adding Weather Description

  • From the Home menu or Insert menu, click on the text box icon.
  • Click on the Value Icon to open the Dynamic value options window.
Power BI Dynamic Values Options Box
  • In box showing “How would you calculate this value” enter weather.description. This will tell power BI to use the weather.description column in the Current Weather table. This will work, as we don’t have duplicate column names.
  • Once you have entered weather.description, then Power BI will underline it with a blue line to show that Power BI has recognised the column name. If it is showing red, then Power BI does not recognise the column and you will need to check the current weather table and type in the column name that you have set for the weather description. If you have been following this series, then weather.description will work. You should see the weather description in the result area in this window. As shown here:
Power BI Dynamic Values Options Window Showing the Weather Description.
  • As there is only a single dynamic value in this text box, we don’t need to name the value.
  • Click Save to save the value.

We will now format the text box.

  • Click in the text box to select it.
  • Press CTRL-A to select all the text in the text box.
  • Change the Font Size from 10 to 14.
  • Click the down arrow next to the button with an underlined A to open the font colour menu.
  • Click the More colors option.
  • Click in the Hex box and use the backspace button to remove the existing values.
  • Type in #072C4F .This will set the font colour to a dark blue colour.
  • Now click the format button, at the far right-hand side of the Power BI Desktop window.
  • Expand the size and style option on the visual tab in the format pane.
  • We will now set the height, width, and position of the rectangle.
  • Change the height in the Size and position options from the current value of 300 to 50 by clicking in the height box and entering the new value.
  • Leave the width as 300.
  • Change the horizontal position in the Size and position options from the current value of 100 to 110 by clicking in the horizontal box and entering the new value.
  • Now change the vertical position in the Size and position options from the current value of 100 to 190 by clicking in the vertical box and entering the new value.
  • Now turn off the background by clicking on the background toggle button.

In this part, we added the weather icon and the weather description to the card. In the next part of this series, we will add the temperature information to this card.

Don’t forget to subscribe to

👉 Power BI Publication

👉 Power BI Newsletter

and join our Power BI community

👉 Power BI Masterclass

--

--

Andrew Hubbard
Microsoft Power BI

A Data analyst using Microsoft Power BI to create visualisations. With a keen interest in mental well being.