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

Andrew Hubbard
Microsoft Power BI
Published in
7 min readApr 13, 2024
Sample image from the weather dashboard we will create. Background image in dashboard Photo by Alex Siale on Unsplash.

In the last part of this series, we added the current weather icon and the current weather description to the dashboard. In this part of the series, we will add the current temperature information. We will also add the feels like temperature, maximum temperature and the minimum temperature information to the card. I have included the last three temperatures here, so the temperature information is in one text box, even though the cards above the current weather card already display them.

Adding Current Temperature Information to The Current Weather Card.

Before we can add the icons used, you will need to download icons from an icon website. I suggest uxwings.com as the icons are free and don’t require attribution. Here is the link to the icons I have used for my version of the dashboard Weather Dashboards Icons. I suggest saving the icons in a sub folder called icons. You should complete downloading the icons before continuing. The file names used in the following steps will be the file names from my repository of icons and are .svg files.

The following steps will tell you how to add the icon to the card.

  • To open the insert menu, click Insert in the toolbar at the top of the Power BI Desktop window.
  • Clicking on the down arrow underneath the Button icon to show the buttons that we can add to the report.
  • We will add a blank button. Click on blank from the list of buttons.

Now we will format and position the button.

  • 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 40 to 60 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 100 to 40 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 0 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 0 to 250 by clicking in the vertical box and entering the new value.

Now we will add the thermometer icon to the button

Adding Thermometer Icon

  • Expand the button style options option on the visual tab in the format pane.
  • Make sure that the state says Default. If it is showing anything else, click on the down arrow next to the status box to show the options and select Default from the list.
  • Turn off the icon by clicking on the icon toggle button.
  • Expand the fill option on the visual tab in the button style options.
  • Click the box located just below the Color option it will currently say browse. The windows file explorer will open.
  • Use the file explorer to navigate to where you saved the thermometer icon and select the thermometer icon file. If you wish to use the icon from my collection of icons it is called “thermometer-icon.svg”.
  • Click open to load the icon into the button.
  • Change the transparency from 50% to 0% by either typing in the transparency box or dragging the slider.
  • We will need to change the colour from the default white to the background colour.
  • Expand the Color option.
  • Click the down arrow to expand the colours to use. We will use an orange colour for this rule. You can select the orange colour by clicking on it or you can click on “more colors…” to open a window with hex codes and red, green and blue values. As shown here.
Power BI more colors pop-up window
  • Press the backspace button on your keyboard to clear the current hex value.
  • Enter the following in the hex text box. #F8F8F8. This will set the background to a light grey background. This background will soften the effect of the background image that we will add later, so we can see the information clearly.
  • Finally, if the Border option is showing On, turn off the border by clicking on the Border toggle button.

To add the temperature information to the card, we will use a text box and using the value option in the text box to add the value from the current weather table. This is like using a smart narrative. I prefer this method over using a text box and cards because it keeps the text and values aligned.

Adding Temperature Information

  • From the Home menu or Insert menu, click on the text box icon. This will add the text box to the report canvas.
  • Change the font from Segoe UI to DIN.
  • Set the font size to 14.
  • Type “The current temperature is ” put a space at the end to provide some space for the dynamic value we will add.
  • Click on the Value Icon to open the Dynamic value options window.
Power BI Dynamic Values Options Box
  • In box showing “Ask a question about your data” enter current temperature. This will tell power BI to use the Current Temperature measure we created. As you are typing, you will see “current temperature” appear on the list of columns and measures that appear. Click on current temperature in that list and Power BI will add it for you.
  • Once you have entered current temperature, then Power BI will underline it with a blue line to show that Power BI has recognised the measure name. If it is showing red, then Power BI does not recognise the measure and you will need to clean out what you entered and type in the name again. When Power BI recognizes it, the results area will display the formatted current temperature.
  • We should name this value as we might need to update it at a later date and this will help us find it. To do this, select the text in the value box and type current_temp.
  • Click Save
  • Now we need to format this dynamic value, select the text showing the current temperature. The easiest way is to hold down the shift key and press the left cursor button.
  • Change the font to DIN and set the font size to 14.
  • Click on the Bold icon to make the value bold so it pops out a bit more.
  • The completed text box formatting window should look like this.
Completed Power BI Text Box Formatting Window

Adding Feels Like Temperature

  • Move the cursor inside the text box to the end of the text and press Enter. This will move the cursor to a new line in the text box.
  • The default font name and size will appear. We need to change the font to DIN and font size to 14.
  • Type “But it feels like ” put a space at the end to provide some space for the dynamic value we will add.
  • Click on the Value Icon to open the Dynamic value options window.
  • In box showing “Ask a question about your data” Enter feels like temperature. This will tell power BI to use the Feels Like Temperature measure we created. As you are typing, you will see “feels like temperature” appear on the list of columns and measures that appear. Click on feels like temperature in that list and Power BI will add it for you.
  • Once you have entered feels like temperature, then Power BI will underline it with a blue line to show that Power BI has recognised the measure name. If it is showing red, then Power BI does not recognise the measure and you will need to clean out what you entered and type in the name again. When Power BI recognizes it, the results area will display the formatted feels like temperature.
  • We should name this value as we might need to update it at a later date and this will help us find it. To do this, select the text in the value box and type feels_like_temp.
  • Click Save
  • Now we need to format this dynamic value, select the text showing the feels like temperature. The easiest way is to hold down the shift key and press the left cursor button.
  • Change the font to DIN and set the font size to 14.
  • Click on the Bold icon to make the value bold so it pops out a bit more.

Don’t forget to save your work. In this part of the series, we added the temperature icon and the text for current and feels like temperatures along with their respective dynamic values. In the next part of this series, we will add the maximum and minimum temperatures to this text box.

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.