SlideShare a Scribd company logo
1 of 10
USING DAX & TIME-BASED
ANALYSIS IN DATA WAREHOUSE
Understand Sales Performance Across
Various Products Over Last ThreeYears
Author: Anthony Mok
Date: 18 Nov 2023
Email: xxiaohao@yahoo.com
WHAT ARE...?
Data Analysis Expressions (DAX)
A formula language used in Power Pivot in Excel.
It allows users to create custom calculations for
calculated columns and measures
Time-based Analysis
Used to make informed business
decisions by identifying trends,
patterns, and anomalies in data
Measures
Are calculated fields that are used to perform
aggregations and calculations on data.They are
used in PivotTables and PivotCharts to
summarise and analyse data
PROJECT’S CONTEXT, OBJECTIVE & STRATEGIES
Context
An art dealer friend, who has multiple
sales representatives who sell various
products across four different states in the
US, likes to use the data he has collected to
make insight-driven decisions
Strategies
• Combine sales data from multiple CSV files and add
product and sales rep data to the data model
• Create a date table with a column for the last day of
each month for the purpose of conducting time-based
analysis
• Establish relationships between sales rep, product,
sales, and date tables
• Calculate total net sales excluding discounts
• Create a pivot table showing total sales andYOY%
change for regions, excluding subtotals and individual
regions
Objective
Dealer wants to understand the
sales performance across
various products over the last
three years
CREATE & ADD DATA MODEL TO POWER PIVOT
▪ .csv files for ‘Sales 21’,‘Sales 22’ and
‘Sales 23’ were imported Power
Query
▪ These were combined into a single
file:‘Merged Sales 2021-2023’
▪ Together with the ‘Product’ and
‘Sales Rep’Tables, from the ‘Product
and SalesRep.xlsx’ file, these are
added to the data model in Power
Pivot
MORE DATA MODELS & USING DAX FORMULAE*
▪ To prepare the data model for time-
based analysis, new table, which dates
ranged from 01 January 2021 to 31
December 2023, was created in Power
Pivot
▪ The new date table was renamed as
‘Date’
▪ An additional column, with the last day of
the month for any given month, was
created in this table
▪ DAX formulae used to create this column:
EOM:=FORMAT(EOMONTH('Date'[Date], 0),
"dd/mm/yyyy”
▪ This new column was renamed as ‘EOM’
* This is one of many DAX created in this project. The rest could be found
in the report, which the Art Dealer has requested not to be released
FINALISING DATA MODEL WITH RELATIONSHIPS
▪ The relationships between the ‘Sales
Rep’,‘Product’,‘Sales’ and ‘Date’
tables were created after examining
their for their common key across
tables.
▪ ‘Date’,‘ProductID’ and ‘SalesRepID’
are the keys used to connect the
tables to create the final data model
GENERATING MEASURES* IN POWER PIVOT
Measure to get the ‘Total Net Sales’ was created from the ‘Merged Sales 2021-2023’ Table in Power Pivot:
Steps
▪ Inserted a column between ‘SalesRepID’ and the ‘Units’ columns, and use the Power Pivot DAX’s “RELATED()” function to bring the data
from the ‘Price’ column, in the ‘Product’ Table, into the ‘Merged Sales 2021-2023’ Table
▪ Created two additional columns in the ‘Merged Sales 2021-2023 Table to store the calculated ‘Total Discount’ and ‘Sales’ data
▪ Created the measure for “Net Sales = Total Sales – Discounts”, the “Sum of Total Discount” and the “Sum of Sales”, and these were
formulated and formatted into Singapore Dollars
▪ Finally, the ‘Net Sales’ or ‘Sum of Net Sales’ were created as the final measure in the data model in the Power Pivot, and were formatted
in Singapore Dollars
* This is one of many Measures in this project. The rest could be found in the report, which the Art Dealer has requested not to be released
CREATE PIVOT TABLE FOR TIME-BASED ANALYSIS
Created a PivotTable with total sales andYOY%
change in sales across regions (AL, CO, CA, FL)
to conduct time-based analysis
* These are just five of many Measures created in this project for analysis
* The rest could be found in the report, which the Art Dealer has requested not to be released
Two new Power Pivot Measures were created in
the ‘Merged Sales 2021-2023’Table in Power Pivot:
▪ ‘Year Sales LastYear’; and
▪ ‘YOY % Change in Sales’
The PivotTable, in
the next slide, was
configured in the
following manner,
through the
PivotTable Fields,
to produce the
outcome of Task 5
FINDINGS, CONCLUSIONS & RECOMMENDATIONS*
▪ In absolute-sales-dollar terms, FL and WA contributed 85% of the Total Sum of Net Sales in the 3-year period of 2021 to
2023
▪ As at 31 December 2023, the AL region performed the best, in TotalYOY % Change In Sales in this 3-year period, against
the other three regions, but it suffered the most significant drop of 43% in sales performance in 2022, against 2021,
before drastically recovering in the following year
▪ This pattern seemed to have repeated in the CA region with a drop of 12% in 2023 as compared to 2022
▪ Overall, the total-YOY-%-Change-In-Sales in this 3-year period for all four regions was 65%, which could be higher if the
year-on-year sales performance for the AL and CA regions were more consistent with the previous year/s
▪ This suggests that the data need to be further explored and mined for the possible and key contributors for the
inconsistent performance of the AL and CA regions, and to see, through the data, whether there are signs of these
reoccurring in these regions or in those regions which are consistently contributing to the overall sales performance of
the company
* These are some of many findings, conclusions and recommendations in this project.
* The rest could be found in the report, which the Art Dealer has requested not to be released
USING DAX & TIME-BASED
ANALYSIS IN DATA WAREHOUSE
Understand Sales Performance Across
Various Products Over Last ThreeYears
Author: Anthony Mok
Date: 18 Nov 2023
Email: xxiaohao@yahoo.com

More Related Content

Similar to Using DAX & Time-based Analysis in Data Warehouse

Analytics for Marketing
Analytics for MarketingAnalytics for Marketing
Analytics for MarketingJen Stirrup
 
Running head COMPANY NAME 1 MBA 7200 Financia.docx
Running head COMPANY NAME  1  MBA 7200 Financia.docxRunning head COMPANY NAME  1  MBA 7200 Financia.docx
Running head COMPANY NAME 1 MBA 7200 Financia.docxtodd271
 
Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...MD Owes Quruny Shubho
 
Dashboards - Supply Chain & Demand Planning examples in Tableau
 Dashboards - Supply Chain & Demand Planning examples in Tableau  Dashboards - Supply Chain & Demand Planning examples in Tableau
Dashboards - Supply Chain & Demand Planning examples in Tableau Chief Innovation
 
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
 
The Financial Analysis House©: from data to dashboards
The Financial Analysis House©: from data to dashboardsThe Financial Analysis House©: from data to dashboards
The Financial Analysis House©: from data to dashboardsDr. Basel Omar Abu-Ali
 
Chapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptx
Chapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptxChapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptx
Chapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptxJiaLing34
 
LECTURE 7.ppt.pdf
LECTURE 7.ppt.pdfLECTURE 7.ppt.pdf
LECTURE 7.ppt.pdfcikajen791
 
RealDirect-Data-Strategy-report
RealDirect-Data-Strategy-reportRealDirect-Data-Strategy-report
RealDirect-Data-Strategy-reportViresh Duvvuri
 
M tech inv_portal_with_dynamics_ax _2018_v_10.00
M tech inv_portal_with_dynamics_ax _2018_v_10.00M tech inv_portal_with_dynamics_ax _2018_v_10.00
M tech inv_portal_with_dynamics_ax _2018_v_10.00ovais99
 
Data Visualization1.pptx
Data Visualization1.pptxData Visualization1.pptx
Data Visualization1.pptxqwtadhsaber
 
Finc 3304 business finance work the web project part 2 (
Finc 3304 business finance work the web project  part 2 (Finc 3304 business finance work the web project  part 2 (
Finc 3304 business finance work the web project part 2 (arnit1
 
Health Care Research ProjectByDr. Joseph Foy, CPA
Health Care Research ProjectByDr. Joseph Foy, CPAHealth Care Research ProjectByDr. Joseph Foy, CPA
Health Care Research ProjectByDr. Joseph Foy, CPAJeanmarieColbert3
 
Showcase of Reports
Showcase of ReportsShowcase of Reports
Showcase of ReportsGarth Wilson
 
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...QueBIT Consulting
 
Financial Analytics Product Guide.ppt
Financial Analytics Product Guide.pptFinancial Analytics Product Guide.ppt
Financial Analytics Product Guide.pptĐỗ Văn Vinh
 
Financial Analytics
Financial AnalyticsFinancial Analytics
Financial AnalyticsFran Daly
 
Best structure of taxonomies for the different purposes of analysis
Best structure of taxonomies for the different purposes of analysisBest structure of taxonomies for the different purposes of analysis
Best structure of taxonomies for the different purposes of analysisChie Mitsui
 
Financial Analysis Paper Company NameStudent name Da.docx
Financial Analysis Paper  Company NameStudent name Da.docxFinancial Analysis Paper  Company NameStudent name Da.docx
Financial Analysis Paper Company NameStudent name Da.docxAKHIL969626
 

Similar to Using DAX & Time-based Analysis in Data Warehouse (20)

Analytics for Marketing
Analytics for MarketingAnalytics for Marketing
Analytics for Marketing
 
Running head COMPANY NAME 1 MBA 7200 Financia.docx
Running head COMPANY NAME  1  MBA 7200 Financia.docxRunning head COMPANY NAME  1  MBA 7200 Financia.docx
Running head COMPANY NAME 1 MBA 7200 Financia.docx
 
Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...Real -time data visualization using business intelligence techniques. and mak...
Real -time data visualization using business intelligence techniques. and mak...
 
Dashboards - Supply Chain & Demand Planning examples in Tableau
 Dashboards - Supply Chain & Demand Planning examples in Tableau  Dashboards - Supply Chain & Demand Planning examples in Tableau
Dashboards - Supply Chain & Demand Planning examples in Tableau
 
Essbase intro
Essbase introEssbase intro
Essbase intro
 
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
 
The Financial Analysis House©: from data to dashboards
The Financial Analysis House©: from data to dashboardsThe Financial Analysis House©: from data to dashboards
The Financial Analysis House©: from data to dashboards
 
Chapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptx
Chapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptxChapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptx
Chapter 2 - Steps for Building a Financial Model Assumptions to Valuation.pptx
 
LECTURE 7.ppt.pdf
LECTURE 7.ppt.pdfLECTURE 7.ppt.pdf
LECTURE 7.ppt.pdf
 
RealDirect-Data-Strategy-report
RealDirect-Data-Strategy-reportRealDirect-Data-Strategy-report
RealDirect-Data-Strategy-report
 
M tech inv_portal_with_dynamics_ax _2018_v_10.00
M tech inv_portal_with_dynamics_ax _2018_v_10.00M tech inv_portal_with_dynamics_ax _2018_v_10.00
M tech inv_portal_with_dynamics_ax _2018_v_10.00
 
Data Visualization1.pptx
Data Visualization1.pptxData Visualization1.pptx
Data Visualization1.pptx
 
Finc 3304 business finance work the web project part 2 (
Finc 3304 business finance work the web project  part 2 (Finc 3304 business finance work the web project  part 2 (
Finc 3304 business finance work the web project part 2 (
 
Health Care Research ProjectByDr. Joseph Foy, CPA
Health Care Research ProjectByDr. Joseph Foy, CPAHealth Care Research ProjectByDr. Joseph Foy, CPA
Health Care Research ProjectByDr. Joseph Foy, CPA
 
Showcase of Reports
Showcase of ReportsShowcase of Reports
Showcase of Reports
 
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
 
Financial Analytics Product Guide.ppt
Financial Analytics Product Guide.pptFinancial Analytics Product Guide.ppt
Financial Analytics Product Guide.ppt
 
Financial Analytics
Financial AnalyticsFinancial Analytics
Financial Analytics
 
Best structure of taxonomies for the different purposes of analysis
Best structure of taxonomies for the different purposes of analysisBest structure of taxonomies for the different purposes of analysis
Best structure of taxonomies for the different purposes of analysis
 
Financial Analysis Paper Company NameStudent name Da.docx
Financial Analysis Paper  Company NameStudent name Da.docxFinancial Analysis Paper  Company NameStudent name Da.docx
Financial Analysis Paper Company NameStudent name Da.docx
 

More from ThinkInnovation

Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...ThinkInnovation
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...ThinkInnovation
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
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 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
 
Creating Data Warehouse Using Power Query & Power Pivot
Creating Data Warehouse Using Power Query & Power PivotCreating Data Warehouse Using Power Query & Power Pivot
Creating Data Warehouse Using Power Query & Power PivotThinkInnovation
 
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
 

More from ThinkInnovation (18)

Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
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
 
Creating Data Warehouse Using Power Query & Power Pivot
Creating Data Warehouse Using Power Query & Power PivotCreating Data Warehouse Using Power Query & Power Pivot
Creating Data Warehouse Using Power Query & Power Pivot
 
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
 

Recently uploaded

NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...Amil baba
 
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...ssuserf63bd7
 
Easy and simple project file on mp online
Easy and simple project file on mp onlineEasy and simple project file on mp online
Easy and simple project file on mp onlinebalibahu1313
 
Exploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptxExploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptxDilipVasan
 
How I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonHow I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonPayment Village
 
AI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdfAI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdfMichaelSenkow
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfRobertoOcampo24
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Valters Lauzums
 
Pre-ProductionImproveddsfjgndflghtgg.pptx
Pre-ProductionImproveddsfjgndflghtgg.pptxPre-ProductionImproveddsfjgndflghtgg.pptx
Pre-ProductionImproveddsfjgndflghtgg.pptxStephen266013
 
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理pyhepag
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Jon Hansen
 
Supply chain analytics to combat the effects of Ukraine-Russia-conflict
Supply chain analytics to combat the effects of Ukraine-Russia-conflictSupply chain analytics to combat the effects of Ukraine-Russia-conflict
Supply chain analytics to combat the effects of Ukraine-Russia-conflictJack Cole
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理cyebo
 
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理pyhepag
 
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfGenerative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfEmmanuel Dauda
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理pyhepag
 
2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Calllward7
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group MeetingAlison Pitt
 

Recently uploaded (20)

NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
 
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
 
Easy and simple project file on mp online
Easy and simple project file on mp onlineEasy and simple project file on mp online
Easy and simple project file on mp online
 
Exploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptxExploratory Data Analysis - Dilip S.pptx
Exploratory Data Analysis - Dilip S.pptx
 
How I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonHow I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prison
 
AI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdfAI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdf
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdf
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
 
Pre-ProductionImproveddsfjgndflghtgg.pptx
Pre-ProductionImproveddsfjgndflghtgg.pptxPre-ProductionImproveddsfjgndflghtgg.pptx
Pre-ProductionImproveddsfjgndflghtgg.pptx
 
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)
 
Supply chain analytics to combat the effects of Ukraine-Russia-conflict
Supply chain analytics to combat the effects of Ukraine-Russia-conflictSupply chain analytics to combat the effects of Ukraine-Russia-conflict
Supply chain analytics to combat the effects of Ukraine-Russia-conflict
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
 
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
 
Machine Learning for Accident Severity Prediction
Machine Learning for Accident Severity PredictionMachine Learning for Accident Severity Prediction
Machine Learning for Accident Severity Prediction
 
Slip-and-fall Injuries: Top Workers' Comp Claims
Slip-and-fall Injuries: Top Workers' Comp ClaimsSlip-and-fall Injuries: Top Workers' Comp Claims
Slip-and-fall Injuries: Top Workers' Comp Claims
 
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfGenerative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理
 
2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting
 

Using DAX & Time-based Analysis in Data Warehouse

  • 1. USING DAX & TIME-BASED ANALYSIS IN DATA WAREHOUSE Understand Sales Performance Across Various Products Over Last ThreeYears Author: Anthony Mok Date: 18 Nov 2023 Email: xxiaohao@yahoo.com
  • 2. WHAT ARE...? Data Analysis Expressions (DAX) A formula language used in Power Pivot in Excel. It allows users to create custom calculations for calculated columns and measures Time-based Analysis Used to make informed business decisions by identifying trends, patterns, and anomalies in data Measures Are calculated fields that are used to perform aggregations and calculations on data.They are used in PivotTables and PivotCharts to summarise and analyse data
  • 3. PROJECT’S CONTEXT, OBJECTIVE & STRATEGIES Context An art dealer friend, who has multiple sales representatives who sell various products across four different states in the US, likes to use the data he has collected to make insight-driven decisions Strategies • Combine sales data from multiple CSV files and add product and sales rep data to the data model • Create a date table with a column for the last day of each month for the purpose of conducting time-based analysis • Establish relationships between sales rep, product, sales, and date tables • Calculate total net sales excluding discounts • Create a pivot table showing total sales andYOY% change for regions, excluding subtotals and individual regions Objective Dealer wants to understand the sales performance across various products over the last three years
  • 4. CREATE & ADD DATA MODEL TO POWER PIVOT ▪ .csv files for ‘Sales 21’,‘Sales 22’ and ‘Sales 23’ were imported Power Query ▪ These were combined into a single file:‘Merged Sales 2021-2023’ ▪ Together with the ‘Product’ and ‘Sales Rep’Tables, from the ‘Product and SalesRep.xlsx’ file, these are added to the data model in Power Pivot
  • 5. MORE DATA MODELS & USING DAX FORMULAE* ▪ To prepare the data model for time- based analysis, new table, which dates ranged from 01 January 2021 to 31 December 2023, was created in Power Pivot ▪ The new date table was renamed as ‘Date’ ▪ An additional column, with the last day of the month for any given month, was created in this table ▪ DAX formulae used to create this column: EOM:=FORMAT(EOMONTH('Date'[Date], 0), "dd/mm/yyyy” ▪ This new column was renamed as ‘EOM’ * This is one of many DAX created in this project. The rest could be found in the report, which the Art Dealer has requested not to be released
  • 6. FINALISING DATA MODEL WITH RELATIONSHIPS ▪ The relationships between the ‘Sales Rep’,‘Product’,‘Sales’ and ‘Date’ tables were created after examining their for their common key across tables. ▪ ‘Date’,‘ProductID’ and ‘SalesRepID’ are the keys used to connect the tables to create the final data model
  • 7. GENERATING MEASURES* IN POWER PIVOT Measure to get the ‘Total Net Sales’ was created from the ‘Merged Sales 2021-2023’ Table in Power Pivot: Steps ▪ Inserted a column between ‘SalesRepID’ and the ‘Units’ columns, and use the Power Pivot DAX’s “RELATED()” function to bring the data from the ‘Price’ column, in the ‘Product’ Table, into the ‘Merged Sales 2021-2023’ Table ▪ Created two additional columns in the ‘Merged Sales 2021-2023 Table to store the calculated ‘Total Discount’ and ‘Sales’ data ▪ Created the measure for “Net Sales = Total Sales – Discounts”, the “Sum of Total Discount” and the “Sum of Sales”, and these were formulated and formatted into Singapore Dollars ▪ Finally, the ‘Net Sales’ or ‘Sum of Net Sales’ were created as the final measure in the data model in the Power Pivot, and were formatted in Singapore Dollars * This is one of many Measures in this project. The rest could be found in the report, which the Art Dealer has requested not to be released
  • 8. CREATE PIVOT TABLE FOR TIME-BASED ANALYSIS Created a PivotTable with total sales andYOY% change in sales across regions (AL, CO, CA, FL) to conduct time-based analysis * These are just five of many Measures created in this project for analysis * The rest could be found in the report, which the Art Dealer has requested not to be released Two new Power Pivot Measures were created in the ‘Merged Sales 2021-2023’Table in Power Pivot: ▪ ‘Year Sales LastYear’; and ▪ ‘YOY % Change in Sales’ The PivotTable, in the next slide, was configured in the following manner, through the PivotTable Fields, to produce the outcome of Task 5
  • 9. FINDINGS, CONCLUSIONS & RECOMMENDATIONS* ▪ In absolute-sales-dollar terms, FL and WA contributed 85% of the Total Sum of Net Sales in the 3-year period of 2021 to 2023 ▪ As at 31 December 2023, the AL region performed the best, in TotalYOY % Change In Sales in this 3-year period, against the other three regions, but it suffered the most significant drop of 43% in sales performance in 2022, against 2021, before drastically recovering in the following year ▪ This pattern seemed to have repeated in the CA region with a drop of 12% in 2023 as compared to 2022 ▪ Overall, the total-YOY-%-Change-In-Sales in this 3-year period for all four regions was 65%, which could be higher if the year-on-year sales performance for the AL and CA regions were more consistent with the previous year/s ▪ This suggests that the data need to be further explored and mined for the possible and key contributors for the inconsistent performance of the AL and CA regions, and to see, through the data, whether there are signs of these reoccurring in these regions or in those regions which are consistently contributing to the overall sales performance of the company * These are some of many findings, conclusions and recommendations in this project. * The rest could be found in the report, which the Art Dealer has requested not to be released
  • 10. USING DAX & TIME-BASED ANALYSIS IN DATA WAREHOUSE Understand Sales Performance Across Various Products Over Last ThreeYears Author: Anthony Mok Date: 18 Nov 2023 Email: xxiaohao@yahoo.com