SlideShare una empresa de Scribd logo
CREATING DATA WAREHOUSE
USING POWER QUERY & POWER PIVOT
DATA WAREHOUSE OF MEANINGFUL INFORMATION ON ROAD ACCIDENTS
Author: Anthony Mok
Date: 18 Nov 2023
Email: xxiaohao@yahoo.com
WHAT IS POWER QUERY & POWER PIVOT
Excel Power Query
A data
transformation and
preparation tool
that simplifies the
process of
importing, shaping,
and analysing data
from various
sources
Excel Power Pivot
A data modeling
add-in for Excel
that enables us to
create
sophisticated data
models, analyse
large datasets, and
perform complex
calculations
PROJECT’S CONTEXT, OBJECTIVE & STRATEGIES
Context
Social Enterprise, from a neighboring
country which provides ambulatory
services, has collected data on road
accidents and is keen to use the data
to inform on its resource deployment.
It has stored the data into three files:
‘Accidents.xlsx’, ‘Casualties.xlsx’ and
‘Vehicles.txt’
Objective
Create a data warehouse
containing meaningful
information on road
accidents
Strategies
 Import file and transform
data
 Create queries as a new
table
 Merge these tables
 Summary table
 Power Pivot and create a
data model
IMPORT 1ST FILE, TRANSFORM DATA & CREATE 1ST POWER QUERY
 The file: ‘data warehouse on road
accidents.xlsx’, was created in MS Excel, and
the ‘Accidents0515 sheet’ from the
‘Accidents.xlsx’ file was imported into this
data warehouse.xlsx file to conduct data
transformation
 In the ‘Day_of_Week’ column, in the
‘Accidents0515 sheet’, records with value of
-1 were excluded since this is an impossible
value
 Format of the ‘Date’ column was changed to
text since this is not a numerical data
 In the ‘Speed_limit’ column, only records that
are 40 and above were selected
 When loading the ‘Accidents0515’ sheet into
Power Pivot, ‘Only Create Connection’ option
was chosen since this would be combined
with the 2nd Power Query to form a new query
IMPORT 2ND FILE, TRANSFORM DATA & CREATE 2ND POWER QUERY
▪ The ‘Vehicles.xlsx’ file was imported
into the MS Excel file: ‘data warehouse
on road accidents.xlsx’
▪ Records with value of -1 in the
‘Age_of_Vehicle’ and ‘Age_of_Driver’
columns were excluded since this is an
impossible value
 When loading the ‘Vehicles0515’ sheet
into Power Pivot, ‘Only Create
Connection’ option was chosen since
this would be combined with the 1st
Power Query already created to form a
new combined query
MERGE TWO QUERIES TO CREATE NEW COMBINED POWER QUERY
▪ The ‘Accident0515’ and ‘Vehicle0515’
queries were merged to create the new
‘Vehicles with Accident History’ query
▪ The ‘Accident_index’ was used as the
key to merge these two queries
▪ When loading the ‘Vehicles with
Accident History’ table, ‘Only Create
Connection’ option was chosen since
there is one more Power Query to
create before loading these 3 queries
into Power Pivot as a data model
PREPARE SUMMARY TABLE TO CREATE FINAL POWER QUERY
▪ The ‘Casualties.xlsx’ file was imported into the
MS Excel file: ‘data warehouse on road
accidents.xlsx’
▪ The ‘Summary Table of Total Pedestrian Cases
By Casualty Severity Types’ was prepared,
through Power Pivot, with the following columns:
▪ Total Number of Accidents
▪ Average Age of Casualty (using the variable:
‘Age_of_Casualty’)
▪ Total Pedestrian Cases (using the variable:
‘Pedestrian Indicator’) for each
‘Casualty_Severity’ type (using the variable:
‘Casualty_Severity’)
▪ When loading the “Casualties0515” sheet, ‘Only
Create Connection’ option was chosen since this
is the final Power Query to create before loading
this and two previously created queries into
Power Pivot as a data model
CREATE DATA MODEL FROM 3 POWER QUERIES
Loading Power Queries into
Power Pivot as Data Model
The ‘Accidents 0515’, ‘vehicles05151 and
‘causalities0515’ Power Queries were loaded into
Power Pivot as a data model
Excel Power Pivot
To complete the data modelling process, at the Diagram View module in
the Power Pivot workspace, the four tables were linked, using the:
 ‘Accident_index’ key for the ‘Accidents 0515’, ‘vehicles0515’ and
‘causalities0515’ tables,
 ‘Vehicle_Type’ key for the ‘vehicles0515’ and ‘Vehicle_Description’
tables (the “F1” key in the ‘Vehicle_Description’ table is the
‘Vehicle_Type’ key)
CREATING DATA WAREHOUSE
USING POWER QUERY & POWER PIVOT
DATA WAREHOUSE OF MEANINGFUL INFORMATION ON ROAD ACCIDENTS
Author: Anthony Mok
Date: 18 Nov 2023
Email: xxiaohao@yahoo.com

Más contenido relacionado

Más de ThinkInnovation

Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...
Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...
Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...
ThinkInnovation
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
ThinkInnovation
 
Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...
Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...
Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...
ThinkInnovation
 
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
ThinkInnovation
 
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
ThinkInnovation
 
Decision Making Under Uncertainty - Decide Whether Or Not to Take Precautions
Decision Making Under Uncertainty - Decide Whether Or Not to Take PrecautionsDecision Making Under Uncertainty - Decide Whether Or Not to Take Precautions
Decision Making Under Uncertainty - Decide Whether Or Not to Take Precautions
ThinkInnovation
 
Optimal Decision Making - Cost Reduction in Logistics
Optimal Decision Making - Cost Reduction in LogisticsOptimal Decision Making - Cost Reduction in Logistics
Optimal Decision Making - Cost Reduction in Logistics
ThinkInnovation
 
Create Data Model & Conduct Visualisation in Power BI Desktop
Create Data Model & Conduct Visualisation in Power BI DesktopCreate Data Model & Conduct Visualisation in Power BI Desktop
Create Data Model & Conduct Visualisation in Power BI Desktop
ThinkInnovation
 
Using DAX & Time-based Analysis in Data Warehouse
Using DAX & Time-based Analysis in Data WarehouseUsing DAX & Time-based Analysis in Data Warehouse
Using DAX & Time-based Analysis in Data Warehouse
ThinkInnovation
 
Unlocking New Insights Into the World of European Soccer Through the European...
Unlocking New Insights Into the World of European Soccer Through the European...Unlocking New Insights Into the World of European Soccer Through the European...
Unlocking New Insights Into the World of European Soccer Through the European...
ThinkInnovation
 
Breakfast Talk - Manage Projects
Breakfast Talk - Manage ProjectsBreakfast Talk - Manage Projects
Breakfast Talk - Manage Projects
ThinkInnovation
 
Think innovation issue 4 share - scamper
Think innovation issue 4   share - scamperThink innovation issue 4   share - scamper
Think innovation issue 4 share - scamper
ThinkInnovation
 
SCAMPER
SCAMPERSCAMPER
Reverse Assumption Method
Reverse Assumption MethodReverse Assumption Method
Reverse Assumption Method
ThinkInnovation
 
Psyche of Facilitation - The New Language of Facilitating Conversations
Psyche of Facilitation - The New Language of Facilitating ConversationsPsyche of Facilitation - The New Language of Facilitating Conversations
Psyche of Facilitation - The New Language of Facilitating Conversations
ThinkInnovation
 
Visual Connection - Ideation Through Word Association
Visual Connection - Ideation Through Word AssociationVisual Connection - Ideation Through Word Association
Visual Connection - Ideation Through Word Association
ThinkInnovation
 

Más de ThinkInnovation (16)

Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...
Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...
Ordinary Least Square Regression & Stage-2 Regression - Factors Influencing M...
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 
Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...
Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...
Decision Making Under Uncertainty - Predict the Chances of a Person Suffering...
 
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
 
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
 
Decision Making Under Uncertainty - Decide Whether Or Not to Take Precautions
Decision Making Under Uncertainty - Decide Whether Or Not to Take PrecautionsDecision Making Under Uncertainty - Decide Whether Or Not to Take Precautions
Decision Making Under Uncertainty - Decide Whether Or Not to Take Precautions
 
Optimal Decision Making - Cost Reduction in Logistics
Optimal Decision Making - Cost Reduction in LogisticsOptimal Decision Making - Cost Reduction in Logistics
Optimal Decision Making - Cost Reduction in Logistics
 
Create Data Model & Conduct Visualisation in Power BI Desktop
Create Data Model & Conduct Visualisation in Power BI DesktopCreate Data Model & Conduct Visualisation in Power BI Desktop
Create Data Model & Conduct Visualisation in Power BI Desktop
 
Using DAX & Time-based Analysis in Data Warehouse
Using DAX & Time-based Analysis in Data WarehouseUsing DAX & Time-based Analysis in Data Warehouse
Using DAX & Time-based Analysis in Data Warehouse
 
Unlocking New Insights Into the World of European Soccer Through the European...
Unlocking New Insights Into the World of European Soccer Through the European...Unlocking New Insights Into the World of European Soccer Through the European...
Unlocking New Insights Into the World of European Soccer Through the European...
 
Breakfast Talk - Manage Projects
Breakfast Talk - Manage ProjectsBreakfast Talk - Manage Projects
Breakfast Talk - Manage Projects
 
Think innovation issue 4 share - scamper
Think innovation issue 4   share - scamperThink innovation issue 4   share - scamper
Think innovation issue 4 share - scamper
 
SCAMPER
SCAMPERSCAMPER
SCAMPER
 
Reverse Assumption Method
Reverse Assumption MethodReverse Assumption Method
Reverse Assumption Method
 
Psyche of Facilitation - The New Language of Facilitating Conversations
Psyche of Facilitation - The New Language of Facilitating ConversationsPsyche of Facilitation - The New Language of Facilitating Conversations
Psyche of Facilitation - The New Language of Facilitating Conversations
 
Visual Connection - Ideation Through Word Association
Visual Connection - Ideation Through Word AssociationVisual Connection - Ideation Through Word Association
Visual Connection - Ideation Through Word Association
 

Último

End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
bmucuha
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
exukyp
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
AndrzejJarynowski
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
原版一比一多伦多大学毕业证(UofT毕业证书)如何办理
原版一比一多伦多大学毕业证(UofT毕业证书)如何办理原版一比一多伦多大学毕业证(UofT毕业证书)如何办理
原版一比一多伦多大学毕业证(UofT毕业证书)如何办理
mkkikqvo
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
VyNguyen709676
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
hyfjgavov
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
ihavuls
 
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
yuvarajkumar334
 

Último (20)

End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
原版一比一多伦多大学毕业证(UofT毕业证书)如何办理
原版一比一多伦多大学毕业证(UofT毕业证书)如何办理原版一比一多伦多大学毕业证(UofT毕业证书)如何办理
原版一比一多伦多大学毕业证(UofT毕业证书)如何办理
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
 

Creating Data Warehouse Using Power Query & Power Pivot

  • 1. CREATING DATA WAREHOUSE USING POWER QUERY & POWER PIVOT DATA WAREHOUSE OF MEANINGFUL INFORMATION ON ROAD ACCIDENTS Author: Anthony Mok Date: 18 Nov 2023 Email: xxiaohao@yahoo.com
  • 2. WHAT IS POWER QUERY & POWER PIVOT Excel Power Query A data transformation and preparation tool that simplifies the process of importing, shaping, and analysing data from various sources Excel Power Pivot A data modeling add-in for Excel that enables us to create sophisticated data models, analyse large datasets, and perform complex calculations
  • 3. PROJECT’S CONTEXT, OBJECTIVE & STRATEGIES Context Social Enterprise, from a neighboring country which provides ambulatory services, has collected data on road accidents and is keen to use the data to inform on its resource deployment. It has stored the data into three files: ‘Accidents.xlsx’, ‘Casualties.xlsx’ and ‘Vehicles.txt’ Objective Create a data warehouse containing meaningful information on road accidents Strategies  Import file and transform data  Create queries as a new table  Merge these tables  Summary table  Power Pivot and create a data model
  • 4. IMPORT 1ST FILE, TRANSFORM DATA & CREATE 1ST POWER QUERY  The file: ‘data warehouse on road accidents.xlsx’, was created in MS Excel, and the ‘Accidents0515 sheet’ from the ‘Accidents.xlsx’ file was imported into this data warehouse.xlsx file to conduct data transformation  In the ‘Day_of_Week’ column, in the ‘Accidents0515 sheet’, records with value of -1 were excluded since this is an impossible value  Format of the ‘Date’ column was changed to text since this is not a numerical data  In the ‘Speed_limit’ column, only records that are 40 and above were selected  When loading the ‘Accidents0515’ sheet into Power Pivot, ‘Only Create Connection’ option was chosen since this would be combined with the 2nd Power Query to form a new query
  • 5. IMPORT 2ND FILE, TRANSFORM DATA & CREATE 2ND POWER QUERY ▪ The ‘Vehicles.xlsx’ file was imported into the MS Excel file: ‘data warehouse on road accidents.xlsx’ ▪ Records with value of -1 in the ‘Age_of_Vehicle’ and ‘Age_of_Driver’ columns were excluded since this is an impossible value  When loading the ‘Vehicles0515’ sheet into Power Pivot, ‘Only Create Connection’ option was chosen since this would be combined with the 1st Power Query already created to form a new combined query
  • 6. MERGE TWO QUERIES TO CREATE NEW COMBINED POWER QUERY ▪ The ‘Accident0515’ and ‘Vehicle0515’ queries were merged to create the new ‘Vehicles with Accident History’ query ▪ The ‘Accident_index’ was used as the key to merge these two queries ▪ When loading the ‘Vehicles with Accident History’ table, ‘Only Create Connection’ option was chosen since there is one more Power Query to create before loading these 3 queries into Power Pivot as a data model
  • 7. PREPARE SUMMARY TABLE TO CREATE FINAL POWER QUERY ▪ The ‘Casualties.xlsx’ file was imported into the MS Excel file: ‘data warehouse on road accidents.xlsx’ ▪ The ‘Summary Table of Total Pedestrian Cases By Casualty Severity Types’ was prepared, through Power Pivot, with the following columns: ▪ Total Number of Accidents ▪ Average Age of Casualty (using the variable: ‘Age_of_Casualty’) ▪ Total Pedestrian Cases (using the variable: ‘Pedestrian Indicator’) for each ‘Casualty_Severity’ type (using the variable: ‘Casualty_Severity’) ▪ When loading the “Casualties0515” sheet, ‘Only Create Connection’ option was chosen since this is the final Power Query to create before loading this and two previously created queries into Power Pivot as a data model
  • 8. CREATE DATA MODEL FROM 3 POWER QUERIES Loading Power Queries into Power Pivot as Data Model The ‘Accidents 0515’, ‘vehicles05151 and ‘causalities0515’ Power Queries were loaded into Power Pivot as a data model Excel Power Pivot To complete the data modelling process, at the Diagram View module in the Power Pivot workspace, the four tables were linked, using the:  ‘Accident_index’ key for the ‘Accidents 0515’, ‘vehicles0515’ and ‘causalities0515’ tables,  ‘Vehicle_Type’ key for the ‘vehicles0515’ and ‘Vehicle_Description’ tables (the “F1” key in the ‘Vehicle_Description’ table is the ‘Vehicle_Type’ key)
  • 9. CREATING DATA WAREHOUSE USING POWER QUERY & POWER PIVOT DATA WAREHOUSE OF MEANINGFUL INFORMATION ON ROAD ACCIDENTS Author: Anthony Mok Date: 18 Nov 2023 Email: xxiaohao@yahoo.com