Introduction To Data Modeling For Power BI - Gray
Introduction To Data Modeling For Power BI - Gray
com
INTRODUCTION TO
1 2
BI Architectural
Review
On-Site
Consulting
Custom Training
& Mentoring w w w .s qlbi.co m
3 4
5 6
1
Granularity and table size Scattered information
o Increasing granularity increase the size of the model o Higher granularity is not always the best choice
• More columns More rows o Too high is as bad as too low
o You quickly hit the limit of 1M rows of Excel… o Example: yearly income repeated on every row
Category Subcategory Sales
7 8
9 10
11 12
2
Granularity with multiple tables
o With multiple tables, granularity is a different topic
o Each table has its own granularity Adding and removing tables is the key skill of any data modeler
13 14
2 Contoso
o Denormalization is the opposite of normalization, that is
3 Fabrikam
increasing data redundancy, with the goal of improving
4 Proseware
the understanding of the model
5 The Phone Company
o Let us see the concept with some examples … …
15 16
17 18
3
Denormalized model (BI model)
o Denormalization is welcome, to make the model easier
Star schemas are the most popular way of modeling data in Business Intelligence
19 20
21 22
Dimension
23 24
4
Star schemas If you don’t have a star schema
o Very easy to understand at first glance o Most of the times, you are in trouble
• You slice by dimensions and aggregate facts o Any model change towards a star schema is a good step
• There is no ambiguity
o We will see several examples of this
• One level of indirection makes it easy to see roles of tables
o Very fast o Your model is not different from all the other ones
• Modern engines are optimized for star schemas • As anybody else, you have a “special” model
• With special requirements and special calculations
o Drive a clean modeling path
• However, a star schema will fit it well!
• Numbers go in the fact table
o If you are unable to identify facts and dimensions
• Strings go in the dimension
• Everything else… we need to understand what it is • It is likely you still have to understand well the model
25 26
27 28
29 30
5
Common scenarios
o Header / detail tables
o Multiple fact tables
31 32
33 34
Dimension
Dimension
Dimension
35 36
6
Back to a star schema
Once correctly denormalized, the model becomes a star
schema again.
Computing over multiple star schemas
37 38
39 40
41 42
7
Multiple date tables
Fact
o Multiple date tables
In a fact table you might have multiple dates, how should you handle them? o Single fact table
43 44
Fact
45 46
47 48
8
Employees, with salary and stores Precompute the values
o Using two calculated columns
o Remove the links with the bridge tables
Dimension
Fact
Dimension
Fact
Dimension
Dimension
Helper Helper
49 50
Thank you!
We write We teach We provide We are recognized
Books Courses Consulting BI Experts
Remote
Consulting
Power BI/SSAS
Optimization
BI Architectural
Review
On-Site
Consulting
Custom Training
& Mentoring w w w .s qlbi.co m
Check our articles, whitepapers and courses on
www.sqlbi.com
51 52