Power BI is a fantastic tool for visualizing data — and you can easily integrate live weather data into your reports too. In this blog, we’ll walk you through the process of building a real-time weather dashboard powered by WeatherAPI, and then we’ll add some Air Quality Index (AQI) indicators for a richer dashboard experience.
🎯 Why WeatherAPI?
WeatherAPI.com is a simple and powerful service that returns live, historical, and forecast weather data — perfect for Power BI. The data is available in JSON format, making it easy to process and transform.
🛠️ Prerequisites
✅ A free or paid account on WeatherAPI.com
✅ Power BI Desktop installed
✅ Basic Power BI data model knowledge
🔑 Step 1: Get Your WeatherAPI Key
Sign up at WeatherAPI.com, then copy your API key.
You’ll use this key to authenticate API calls.
🌐 Step 2: Build the API URL
For current weather data, use:
🧠 Step 3: Connect Power BI to WeatherAPI
Open Power BI Desktop.
Click Get Data → Web.
Enter your WeatherAPI URL.
Click OK.
🧹 Step 4: Transform the Data
Power BI will show a preview in the Power Query Editor:
Expand the
current
record.Expand sub-records like
condition
orair_quality
.Rename columns for clarity.
Click Close & Apply.
📊 Step 5: Build Your Dashboard
Add:
✅ Cards for temperature, humidity, etc.
✅ Gauges for wind speed.
✅ Charts for daily variations.
And you can also set up filters/slicers for different cities.
🎨 Step 6: Styling & Interactivity
Insert icons representing the current weather.
Plot the map visual with city locations.
Allow your users to select cities dynamically.
⚡ Step 7: Adding AQI Indicators with Reusable Measures
You can easily incorporate Air Quality Index (AQI) data into your report using the current.air_quality
part of the WeatherAPI response.
Here’s a quick Power BI DAX pattern you can copy-paste and adapt to your needs:
🎨 Generic Template for AQI Color:
💡 Simply copy this measure and replace COLUMN_NAME
with the air quality column you want to check — for example:
pm2_5
co
no2
🎨 Generic Template for AQI Suggestion:
🎨 Generic Template for AQI Status:
✅ Again, just replace COLUMN_NAME
with the pollutant of interest.
💡 Quick Tip:
Keep these generic DAX measures as templates — so when you want to add AQI visualizations for new pollutants like so2
, no2
, or o3
, you only need to copy-paste and tweak one column name.
🎉 Conclusion
By integrating WeatherAPI into Power BI, you can create a dynamic weather dashboard with live data, then enrich it with custom AQI visualizations — all in a few easy steps. With these reusable DAX measures, your dashboard stays scalable, maintainable, and easy to enhance as your requirements grow.
Happy dashboarding! 🎨