Intermediate Data Modeling in Power BI
Maarten Van den Broeck
Content Developer

| Method | Advantages | Disadvantages |
|---|---|---|
| Host in a database | Great if you pull data from a warehouse! | Requires a database |
| Easiest to share with multiple services, updating is easy | ||
| Store data in a file | No database required, create one time | Need to create the file |
| Power BI support for text files is great | Updating is not as easy as hosting in a database | |
| Create using DAX | Allows for further customization than the prior two options | Need to write custom code |
| Does not require external prep work | Some functionality may be more difficult to accomplish here |
Month_Year =CALENDAR(DATE(1950, 1, 1), TODAY()),
CALENDAR() is a built-in function to return all dates in a rangeMonth_Year =CALENDAR(DATE(1950, 1, 1), TODAY()),
CALENDAR() is a built-in function to return all dates in a range[Date] field with each date between 1950-01-01 and today
$$
$$
$$| [Date] |
|---|
| 1950-01-01 |
| 1950-01-02 |
| ... |
| 2021-06-30 |
Month_Year =SELECTCOLUMNS(CALENDAR(DATE(1950, 1, 1), TODAY()),"Month", MONTH([Date]), "Year", YEAR([Date]) )
CALENDAR() is a built-in function to return all dates in a range[Date] field with each date between 1950-01-01 and today| Month | Year |
|---|---|
| 01 | 1950 |
| 01 | 1950 |
| ... | ... |
| 06 | 2021 |
Month_Year =DISTINCT(SELECTCOLUMNS(CALENDAR(DATE(1950, 1, 1), TODAY()),"Month", MONTH([Date]), "Year", YEAR([Date]) ))
CALENDAR() is a built-in function to return all dates in a range[Date] field with each date between 1950-01-01 and today| Month | Year |
|---|---|
| 01 | 1950 |
| 02 | 1950 |
| ... | ... |
| 06 | 2021 |

Relationships are based on keys
Two types of keys:
Power BI requires single column relationships
Relationships are based on keys
Two types of keys:
Power BI requires single column relationships
| First Name | Last Name | Birth year | Value |
|---|---|---|---|
| Chris P | Bacon | 1996 | 599 |
| Jane | Bonds | 1998 | 523 |
| Dwayne | Pipe | 1988 | -566 |
$$
| Composite Key | Value |
|---|---|
| Chris P-Bacon-1996 | 599 |
| Jane-Bondts-1998 | 523 |
| Dwayne-Pipe-1988 | -566 |
$$



Less common:
One-to-one
$$
Many-to-many


Intermediate Data Modeling in Power BI