Difficulty Rating: 3 out of 5
Period data is often provided with date values only, and this is wholly sufficient when the analysis periods are one day or longer. The analysis of intraday periods by definition needs a time component, and such a dataset often contains a single date-time value. This workout explores the use of a dedicated [Times] table to enable the analysis of intraday periods.
Goals
- • create a dedicated [Times] table
- • extend the raw data with both a dedicated time value and a dedicate date value
- • extend the raw data with a time key
- • create a star schema data model from the referenced tables using only key columns for linking
Tasks
Produce a Power BI file that:
- • creates a [Trips] fact table from the NYC Taxi 2013 sample data provided
- • creates a [Times] dimension table from the Enterprise DNA Time Table (both link and code provided)
- • (as in data modelling workout 02) creates a [Dates] dimension table with the following characteristics:
- • uses a function created from the Enterprise DNA Extended Date Table code (both link and code provided)
- • uses parameters to determine the earliest and latest order dates in the trips data
- • uses parameters to determine the final date range (full years covering the earliest and latest trip dates)
- • (the end date should be 1 year later to allow for forecasts)
• creates a [Key Measures] table to house the DAX measures created from the DAX data provided
• links the [Times], [Dates], and [Trips] tables into a star schema data model
• includes slicers, a matrix, and cards to showcase the [Times] and [Dates] tables “in action” (i.e., while making slicer selections)
Notes
• use only the DAX code provided; do not modify nor create additional measures or calculated columns
• (data source: a subset (approx. 800,000 rows) of the Microsoft [NYCTaxi_Sample] sample database)
Submission
Using the only the data and DAX files provided, create your solution, and reply to this post. Upload the following:
- • a screenshot of the queries pane of the [Power Query Editor] with all groups expanded
- • a screenshot of the data model as displayed in the [Model View]
- • a screenshot of the [Manage Relationships] dialog
- • an animated GIF of your Power BI file “in action” (i.e., while making slicer selections)
- • the M code for the [Trips] table
Please blur your screenshots and GIFs or place them in a hidden section.
(While this workout builds upon the skills inherent in previous workouts, it is recommended that respondents do not use existing Power BI files as starting points, but rather start a new file from scratch. While this may involve some repetition, that is actually the point, as it serves to reinforce the tasks/activities inherent in a good data model; practice makes …)
Period
This workout will be released on Monday May 29, 2023, and the author’s solution will be posted on Sunday June 11, 2023.
Edit 2023-06-04: the “active” period for this workout has been extended to 2 weeks and the solution posting date has been revised accordingly..
Greg
Data Modelling Workout 08 - Data - NYC Taxi Sample.xlsx (22.1 MB)
Data Modelling Workout 08 - DAX Measures.txt (1.5 KB)
eDNA Forum - Extended Dates Table:
eDNA Forum - Times Table: