A Calendar Table

Now that we have our data in a nice star schema let’s add a couple of calendar tables to help us work with the dates.

Some people might add just one calendar table and have two relationships to the fact table, one active and one disabled. They then switch which relationship is active when writing their DAX measures. I prefer to just add one calendar table for each date I want to work with. It doesn’t take up that much space and it simplifies my DAX code.

You can get a calendar table from many places on the internet. Here is a good one: Avi Singh’s “Ultimate Calendar Table”

This ends the example for Slogan 1. We could have done this work in Power Query instead of SQL. There are always many ways to do anything in Power BI. We will use this same example to illustrate some of the other slogans.