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

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

Building on the previous part of this series, where we added the temperature information to the dashboard. In this part we will add the wind information. The following steps will take you through adding this information. You can download the icons used in this dashboard from here: Weather Dashboards Icons. Or you could use icons from uxwing which is a collection of free icons you can download for commercial projects without attribution.

Adding Wind Information to the Dashboard

  • Click Insert in the toolbar at the top of the Power BI Desktop window to open the inset menu.
  • 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 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 100 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 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 350 by clicking in the vertical box and entering the new value.

Now we will add the wind icon to the button.

Adding Wind 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 wind icon and select the wind icon file. If you used the icon from my collection of icons ,it will be called “wind-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.

Creating Wind Strength Description Measure

Before we add the wind information, we should create a measure to improve the wording of the wind strength description. To do this, follow the steps below:

  • Click on the “_All Measures” table to select it.
  • Select the “New Measure” button in the Table Tools ribbon. Or you can right click on the table and select New Measure from the pop-up menu that appears.
  • Clear out the existing text and replace it with the DAX code here
Wind Strength Description = 
SWITCH(
MIN('Current Weather'[wind speed description]),
"Calm","calmly",
"Light Air","light air",
"a " & LOWER(MIN('Current Weather'[wind speed description]))
)

Adding Wind Information

  • From the Home menu or Insert menu, click on the text box icon. 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 wind is blowing ” 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 wind strength description. This will tell power BI to use the Wind Strength Description measure we created. As you are typing, you will see “wind strength description” appear on the list of columns and measures that appear. Click on wind strength description in that list and Power BI will add it for you.
  • Once you have entered wind strength description, 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 wind strength description.
  • 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 wind_strength_description.
  • Click Save
  • Now we need to format this dynamic value, select the text showing the wind strength description. 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
  • now click in the text box after the text for the dynamic value we just added.
  • Type “ from the ” 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.
  • If the previous dynamic value is showing click Cancel and then click on the Value icon again, a blank window should now appear.
  • In box showing “Ask a question about your data” enter wind direction description. This will tell power BI to use the Wind Direction Description column from the Current Weather table. As you are typing, you will see “wind direction description” appear on the list of columns and measures that appear. Click on wind direction description in that list and Power BI will add it for you.
  • Once you have entered wind direction description, 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 wind direction description.
  • 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 wind_direction_description.
  • Click Save
  • Now we need to format this dynamic value, select the text showing the wind direction description. 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.
  • We need to add the final value for the wind information. Click in the text box after the text for the dynamic value we just added.
  • Type “ at a speed of ” 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.
  • If the previous dynamic value is showing click Cancel and then click on the Value icon again, a blank window should now appear.
  • In box showing “Ask a question about your data” enter current weather speed. This will tell power BI to use the speed column from the Current Weather table. As you are typing, you will see “current weather speed” appear on the list of columns and measures that appear. Click on current weather speed in that list and Power BI will add it for you.
  • Once you have entered current weather speed, 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 wind direction description.
  • 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_wind_speed.
  • Click Save
  • Now we need to format this dynamic value, select the text showing the current wind speed. 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.
  • We will now add the wind speed unit. For me, I will use m/s for metres per second if you are using imperial units, then I believe you will use miles per hour or mph. To add the units, click in the text box after the text for the dynamic value we just added.
  • Type “ m/s” or “ mph”.
  • If the font and size is not the same as the previous text you have entered, then select the text you have just entered and change the font to DIN and set the font size to 14.

Now we need to size and position this text box.

  • 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 95 by clicking in the height box and entering the new value.
  • Leave the width in the at the current value of 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 340 by clicking in the vertical box and entering the new value.
  • If the background toggle button shows on. Turn off the background for the text box by clicking on the background toggle button.

Finally, we will set the font colour for this text box to a dark blue to soften the look of the text.

  • Click in the text box and press CTRL-A.
  • Expand the font color menu.
  • Select More colors…
  • Enter #072C4F into the Hex box.

We have now completed adding the wind information to the card. In the next part of this series, we will add the air pressure 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.