SlideShare une entreprise Scribd logo
1  sur  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
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

Contenu connexe

Plus de 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 PrecautionsThinkInnovation
 
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 LogisticsThinkInnovation
 
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 DesktopThinkInnovation
 
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 WarehouseThinkInnovation
 
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 ProjectsThinkInnovation
 
Think innovation issue 4 share - scamper
Think innovation issue 4   share - scamperThink innovation issue 4   share - scamper
Think innovation issue 4 share - scamperThinkInnovation
 
Reverse Assumption Method
Reverse Assumption MethodReverse Assumption Method
Reverse Assumption MethodThinkInnovation
 
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 ConversationsThinkInnovation
 
Visual Connection - Ideation Through Word Association
Visual Connection - Ideation Through Word AssociationVisual Connection - Ideation Through Word Association
Visual Connection - Ideation Through Word AssociationThinkInnovation
 

Plus de ThinkInnovation (14)

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
 

Dernier

BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 

Dernier (20)

BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

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