In this article, I’m going to show how you can quickly and easily load weather forecast data for any worldwide location into Microsoft Power BI for further analysis. We’ll walk through the process step-by-step showing you how to construct the query in the Visual Crossing Weather web interface and then use the query URL to import the weather forecast results into Power BI.
If you would like to follow along with a video as well, open a browser on the matching YouTube video here: https://youtu.be/vyhI3YGpzjY
The estimated time to complete this exercise is about 5 minutes.
We’ll start by going to the Visual Crossing Weather Data page. We then click on the link to go to weather data download page near the top of the page.
Once on the log-in page, we will sign into our Visual Crossing Weather account. If you don’t already have an account, you can click on the orange button on the right side of the login page. Signing up for a free trial account will give you immediate access to a full 15-day weather forecast for any location.
For this example, we’ll select the option to manually enter a location to use for the weather forecast. However, if you have a sheet of addresses or a list in a text file you could use those directly instead.
Instead of typing an address, we’ll tell the system to use our current location by clicking on the “Populate from your location” link below the location text box. However, we could instead manually type any address, a city name, or a postal code. Optionally, we can also give the location a friendly name so that we can identify this location more easily in the output data.
Next, we need to choose the query type. Since the default query option is a 15-day daily weather forecast, we can just accept the default for the purpose of this tutorial. However, in this panel there are other options including weather history queries, historical data summary reports, and hourly data. These are among the many options covered by our other tutorials and videos. Please see those or reach out to us if you need more information on these options.
When we run the query the default view is the weather calendar. This view provides a simple overview of the result data. The calendar view is very useful for comparing data from different locations side-by-side.
To see more data details we can change to the grid view by clicking the “Raw Grid” button near the top of the page. This view gives a single row for each record in the forecast data. In this example, we will have one row of forecast data for each day of the 15-day forecast at the location we selected. You can see the various weather metrics that are provided in the output data. These metrics include common values such as temperature, precipitation, and wind as well as less common value such as heat index, cloud cover, and wind gusts. For more information on the details regarding our weather metrics, please see our Weather Data Documentation.
We could now download the data as a CSV by pressing the “Download all data” button for manual import into various analysis tools, but instead, we’ll switch to the API view to generate the query URL by clicking the ‘Query API’ button. Using a query URL will allow us to directly import our weather forecast data into Power BI. In addition, this query will allow Power BI to fetch live data and refresh the data so that our forecast data is always current. Since the default query URL output is CSV, which Power BI can read directly, we can simply press the “Copy full query” button to copy the query URL to the clipboard.
We can now use this URL to load the weather query results directly into Power BI. After we load our Power BI interface, we’ll load the data by selecting the Web option from the Get Data menu. This will start the process of importing data via the URL that we just copied.
Power BI will open a prompt asking for the URL from which to fetch the data. Since we already have the query URL copied, we can paste it directly into the URL box and click the OK button to submit the query.
Power BI will now run the weather data query and show us a sample of the results in a preview window. We can see that our forecast query returned many weather metrics including temperature precipitation and wind speed. These metrics are reported for every day during the 15-day forecast period.
When we click on the Load button, Power BI will fetch the entire forecast dataset and make it available for analysis. Once loaded, we can immediately begin using our weather data in our Power BI analyses. We can not only analyze the data directly, we can correlate weather with existing business data to make and adjust plans such as staffing levels, supply levels, optimal operating hours, and more.
If you would like to learn more about using Visual Crossing Weather options such as history data, multiple location import, and use within other analysis tools please see our other tutorials.