This repository contains a Power BI project that focuses on analyzing road accidents in the UK for the year 2022 and 2021. The project aims to provide valuable insights and visualizations to understand various aspects related to road accidents. The dataset used for this analysis includes information such as accident date, accident severity, vehicle type, road type, casualties, and other relevant attributes.
We can carefully seee the values changing if we are selecting different filters with the help of the slicers which is present at the top right corner of the dashboard to make the dashboard more interactive.
You can find the dataset in the gituhub repository only to work upon. It includes information such as Accident_Index, Accident Date, Day_of_Week, Junction_Control, Junction_Detail, Accident_Severity, Latitude, Light_Conditions, Local_Authority_(District), Carriageway_Hazards, Longitude, Number_of_Casualties, Number_of_Vehicles, Police_Force, Road_Surface_Conditions, Road_Type, Speed_limit, Time, Urban_or_Rural_Area, Weather_Conditions, and Vehicle_Type. The dataset has been preprocessed and transformed to ensure its suitability for analysis in Power BI.
To run this project locally, follow these steps:
- Clone the repository using the following command:
git clone https://github.com/Apurv-Here/Accident_Analysis_Power_BI.git
-
Ensure you have Power BI Desktop installed on your machine. If not, download and install it from the official Power BI website.
-
Open Power BI Desktop and navigate to "File" > "Open" > "File" to select the project file located in the cloned repository.
-
Once the project is loaded, you can explore the different dashboards and reports.
To use this project, follow these steps:
-
Open the Power BI project file using Power BI Desktop.
-
Navigate through the various tabs and visuals to explore the road accident data.
-
Interact with the filters and slicers to customize the views according to your requirements.
-
Gain insights from the visualizations and analyze the road accident trends and contributing factors.
The project is structured into the following sections:
- Data Cleaning
- Data Modelling
- Data Visualization
In the data cleaning phase, we performed the following steps:
- Imported the provided CSV data into Power BI and created a table named "Data".
- Renamed the table as "Data" to better reflect its content.
- Removed the spelling mistakes and replaced it with the correct ones to avoid loss of data
- Formatted the date and time column correctly
- Made a calendar table as well
For data modelling, we created the following additional table:
- Calendar: This table contains columns for Date, Year, Month, and Month Number.
We established a one-to-many relationship between the "Calendar" table and the "Data" table based on the date.
We created many new measures in the data table itself to solve our problem.
We used the power bi DAX feature as well such as:
Before starting to solve the problems we can see we need these 4 main measures to build our visualization. PY Accidents PY Casualties YoY Accidents YoY Casualties
DAX for these are:
PY Accidents = CALCULATE(COUNT(Data[Accident_Index]), SAMEPERIODLASTYEAR('Calendar'[Date]))
PY Casualties = CALCULATE(SUM(Data[Number_of_Casualties]), SAMEPERIODLASTYEAR('Calendar'[Date]))
YoY Accidents = ([CY Accidents Count] - [PY Accidents]) / [PY Accidents]
YoY Casualties = ([CY Casualties] - [PY Casualties]) / [PY Casualties]
Now let's explore the visualizations for the seven problem statements:
This card provides an overview of the total casualties and total accidents for the current year, along with their year-over-year (YoY) growth. It helps to identify trends with compare to previous year in percent and understand the impact of road accidents.
This card illustrates the distribution of total casualties by accident severity for the current year. It also shows the YoY growth, providing insights into changes compared to the previous year.
This table displays the total casualties categorized by vehicle type for the current year. It helps to identify which vehicle types are involved in the most accidents.
This line chart compares the monthly casualties for the current year and the previous year. It allows us to analyze the variations in casualties over time.
This bar chart presents the distribution of casualties by road type for the current year. It provides insights into which types of roads are associated with higher accident rates.
These donut column chart showcases the current year's casualties categorized by area/location and further differentiated by day and night. It helps in understanding the patterns of accidents based on different areas and time periods.
This map visualization displays the total casualties and total accidents by location in the UK. It provides a visual representation of the distribution of accidents and casualties across different geographic areas.
The "Road Accident Analysis in UK" Power BI project provides valuable insights into road accidents in the UK. Through data cleaning, modeling, and visualization, we have addressed the seven problem statements related to casualties, accidents, accident severity, vehicle types, monthly trends, road types, and location-based analysis.
The visualizations help in understanding the current year's data, year-over-year growth, and comparisons between different variables. These insights can be utilized to make informed decisions and take necessary measures to improve road safety.
Feel free to explore the code and screenshots provided in this repository to gain a better understanding of the analysis conducted in the "Road Accident Analysis in UK" Power BI project.
Contributions to this project are welcome. If you have any ideas, suggestions, or improvements, please open an issue or submit a pull request.