Weather Analysis and Forecasting in Power BI
Dataset Description(Download Dataset)
-
Formatted Date: Timestamp of the weather observation in a readable format.
-
Summary: Short text description of the weather condition (e.g., Clear, Cloudy).
-
Precip Type: Type of precipitation recorded (e.g., rain, snow, or none).
-
Temperature (C): Actual measured air temperature in degrees Celsius.
-
Apparent Temperature (C): "Feels like" temperature considering wind and humidity.
-
Humidity: Relative humidity as a value between 0 and 1.
-
Wind Speed (km/h): Speed of the wind in kilometers per hour.
-
Wind Bearing (degrees): Wind direction in degrees (0–360, where 0 is north).
-
Visibility (km): Distance in kilometers that one can see clearly.
-
Cloud Cover: Fraction of the sky covered by clouds, ranging from 0 (clear) to 1 (overcast).
-
Pressure (millibars): Atmospheric pressure measured in millibars.
-
Daily Summary: A detailed text summary of the entire day's weather.
Problem Statement:
Accurate weather forecasting remains a challenge due to the dynamic and complex nature of atmospheric conditions. This project aims to analyze historical weather data to identify key patterns and build predictive models that can forecast weather parameters such as temperature, humidity, and precipitation with greater reliability.Step-by-Step Guide: Weather Forecasting in Power BI
Step 1: Upload the Dataset
-
Open Power BI Desktop.
-
Click on Home > Get Data > Excel (or CSV).
-
Browse and select your weather dataset file.
-
Click Load to import the data into Power BI.
Step 2: Transform Dataset in Power Query Editor
Click Transform Data to open Power Query Editor.
-
Split Date and Time (Optional)
-
Select
Formatted Date
→ Split Column by delimiter (space) to createDate
andTime and TimeZone Offset
.
-
-
Rename Columns
-
Correct typos like
"Loud Cover"
→"Cloud Cover"
for clarity.
-
-
Set Data Types
-
Ensure columns like:
-
Date
→ Date -
Temperature
,Humidity
,Wind Speed
→ Decimal Number -
Summary
,Precip Type
→ Text
-
-
-
Handle Missing Values
-
Use Replace Values or Remove Rows for missing/null entries.
Step 3: Add New Calculated Columns
Go to Modeling > New Column and add:
1. TempRange – Measures the difference between how it feels and actual temperature.
-
TempRange = [Apparent Temperature (C)] - [Temperature (C)]
ComfortIndex = 100 - ([Humidity]*100) - ([Wind Speed (km/h)]*0.5)
-
WindCategory = SWITCH(TRUE(), [Wind Speed (km/h)] < 10, "Calm", [Wind Speed (km/h)] < 20, "Breezy", [Wind Speed (km/h)] < 40, "Windy", "Stormy")
DayOfWeek = FORMAT([Date], "dddd")
DayOfWeek = FORMAT([Date], "dddd")
Research Questions & Power BI Steps
Q1: What is the trend of average temperature over time?
🔹 Steps to Visualize:
-
Go to Report View.
-
Add a Line Chart.
-
Set:
-
X-axis: Date
-
Y-axis: Temperature (C)
-
To find monthly or daily averages:
-
Create DAX measure:
Dax: AvgTemperature = AVERAGE('weatherHistory'[Temperature (C)])
Go to Report View.
Add a Line Chart.
Set:
-
X-axis:
Date
-
Y-axis:
Temperature (C)
To find monthly or daily averages:
-
Create DAX measure:
Use this measure in the Y-axis instead.
In Power BI, when you drag a Date column to the X-axis, it automatically creates a date hierarchy with:
Year
-
Quarter
-
Month
-
Day
If You Want to Keep the Hierarchy:
You can expand/collapse the hierarchy directly on the visual:
-
Click the expand arrow (
↓
) on the X-axis to drill down from Year → Quarter → Month → Day. -
Or right-click the chart → Drill options → choose desired level.
If You Want Just One Level (e.g., Month or Date Only):
Do this:
-
In the Fields pane, click the drop-down arrow next to
Date
. -
Select “Date” (not “Date Hierarchy”) and drag it to the X-axis.
Q2: How does apparent temperature differ from actual temperature over days?
🔹 Steps to Visualize:
-
Use a Line Chart.
-
Set:
-
X-axis:
Date
-
Y-axis: Drag both
Temperature (C)
andApparent Temperature (C)
-
Legend: Add both measures to compare
-
-
Optional: Use
Slicer
forMonth
orWeek
.
Q3: What are the most common weather conditions (Summary)?
🔹 Steps to Visualize:
-
Use a Pie Chart or Column Chart.
-
Set:
-
Values: Count of
Summary
-
Legend (if Pie Chart):
Summary
-
🔹 DAX (Optional - Count):
Q4: How does humidity vary throughout the week?
🔹 Steps to Visualize:
-
Create a column:
2. Use a Bar Chart:
-
X-axis:
DayOfWeek
-
Y-axis: AVERAGE of
Humidity
Perform Visualization for Month of the Year to show average Humidity
Q5: How does wind speed vary with wind direction?
🔹 Steps to Visualize:
Use a Scatter Chart.
-
Set:
-
X-axis:
Wind Bearing (degrees)
-
Y-axis:
Wind Speed (km/h)
-
-
Optionally group bearings (e.g., N, NE, E…).
Visualize this new column as follows
Steps to Visualize Wind Speed by Wind Direction (Grouped View)
🔹 Option 1: Column Chart / Bar Chart
This is better than a scatter chart for grouped data.
Go to Report View.
-
Add a Clustered Column Chart or Bar Chart.
-
Set:
-
X-axis →
WindDirection
(the new grouped column) -
Y-axis →
Wind Speed (km/h)
(aggregated automatically — default is average)
-
-
(Optional) Go to the Visualizations pane → Values → Change aggregation to:
-
Average
(to see typical wind speed per direction) -
Or
Max
,Min
,Count
, etc.
-
Q6: Which days had low visibility and what were the corresponding weather summaries?
🔹 Steps to Visualize:
Use a Table visual.
-
Add:
-
Date
-
Visibility (km)
-
Summary
-
-
Use a Filter:
-
Filter
Visibility (km)
less than a threshold (e.g., <5 km).
-
Q7: What is the relationship between cloud cover and temperature?
🔹 Steps to Visualize:
Use a Scatter Chart.
-
Set:
-
X-axis:
Cloud Cover
-
Y-axis:
Temperature (C)
Q8: How many days had rain or snow?
🔹 Steps to Visualize:
-
Use a Column Chart.
-
Set:
-
Axis:
Precip Type
-
Values: Count of
Precip Type
Q9: How does pressure vary with temperature?
🔹 Steps to Visualize:
-
Use a Scatter Chart.
-
Set:
-
X-axis:
Temperature (C)
-
Y-axis:
Pressure (millibars)
Q10: Which weather type corresponds to highest humidity?
🔹 Steps to Visualize:
-
Use a Bar Chart.
-
Set:
-
X-axis: AVERAGE of
Humidity
Y-axis: Summary
Q11: What is the average comfort index by day?
🔹 Add DAX Column: Go to modelling, click new column( Already Created this one in initial stage)
🔹 Steps:
-
Use Bar Chart.
-
X-axis:
DayOfWeek
-
Y-axis: AVERAGE of
ComfortIndex
Q12: Forecast future temperature trend (next 7 days)
🔹 Steps:
-
Create a Line Chart.
-
X-axis:
Date
-
Y-axis: AVERAGE of
Temperature (C)
-
Go to Analytics Pane → Add Forecast:
-
Forecast Length:
7
-
Confidence interval:
95%
Q13: Which month shows highest average wind speed?
🔹 Add DAX Column:
🔹 Steps:
-
Use a Column Chart.
-
X-axis:
MonthName
-
Y-axis: AVERAGE of
Wind Speed (km/h)
Q14: Compare actual vs apparent temperature by month
🔹 Steps:
-
Use a Clustered Column Chart.
-
X-axis:
MonthName
-
Y-axis: AVERAGE of both
Temperature (C)
andApparent Temperature (C)
-
Use Legend to differentiate both series.
Q15: How does temperature behave with changes in cloud cover and humidity?
🔹 Steps:
-
Use a Bubble Chart:
-
X-axis:
Cloud Cover
-
Y-axis:
Temperature (C)
-
Size:
Humidity
-
Legend: Optional (Summary)
-
0 टिप्पण्या
कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏