Excel · PowerPivot

Automatically Generating Date Dimension Tables In Excel 2016 Power Pivot

As you probably know, whenever you are doing any kind of date or time-based calculations in DAX you should always have a separate Date table in your Power Pivot model. There are a number of ways of building these tables (see, for example, my Power Query query here) but they are all a bit of a hassle – which is why it’s so cool that, in Excel 2016, you can get one built automatically inside the Power Pivot window.

Consider the following table of sales data on an Excel worksheet:


With this table loaded into the Data Model (and the Order Date column recognised as containing data of the Date data type), when you go to the Design tab in the Power Pivot window you’ll see the new Date Table button enabled:

Clicking on the New button will add a new date table to the Data Model, called Calendar:

This table is automatically marked as the Date Table in your model.

The table contains a continuous range of dates starting from the beginning of the year of the earliest date found in any column in any table in your Data Model, up to the end of the year containing the latest date found in any column in any table in your Data Model. Obviously, this means that your table could contain a very large date range if, for example, you have a Customer table containing a Date Of Birth column. Luckily, you also have the option of manually configuring the range of dates used by clicking the Update Range button:

One other thing to point out is that the resulting table is a table like any other, so you can add, delete or rename columns as you wish. You should also be able to set the table back to its default state by using the Set Default menu option, but I couldn’t make that work (possibly it hasn’t been implemented yet – this post was written using the Excel 2016 Preview).

If you do make changes like adding calculated columns, such as the Month Year calculated column shown below:

You can then click the Save Configuration button to save the current state of the table as your default. This means that the next time you create a new Date table in the same workbook, the table will include any customisations. However these changes don’t seem to be applied in Date tables created in new workbooks – maybe this will also change before RTM?

All in all, this is a very handy feature that will save Power Pivot modellers a lot of time. I wonder if it uses the new Calendar() or CalendarAuto() DAX functions under the covers?

12 thoughts on “Automatically Generating Date Dimension Tables In Excel 2016 Power Pivot

  1. SutoCom Solutions – SutoCom (aka Sutoprise), has been in business since 1999. With the expertise in team building in business development in Sales, Marketing and customer service evolving in technology with cloud base automation and reaching a wide customer with effective tools. Working with a wide cross section of industries and clientele. We strive not just only producing solo rock stars in business but rock orchestras that carry the tune of generating revenue & exceeding goals. A cliche, but in business there is no "i" in teamwork. The site will be addressing both "best practice" as well as "risk" taking in order to bolster revenue as well as mitigating waste. For example, we do not believe in burning out or using talent till it is all dried up. Nurturing talent and guidance will make a company stronger and solid.
    SutoCom says:

    Reblogged this on SutoCom Solutions.

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.