-
Book Overview & Buying
-
Table Of Contents
Tabular Modeling with SQL Server 2016 Analysis Services Cookbook
By :
In order to make the date table easier to use in reporting, you will add new columns to the table created in the Creating a date table in Visual Studio recipe. In this recipe, you will create columns based on the date column such as year, month, and weekday.
Complete the steps in the Creating a date table in Visual Studio recipe.
Open the Model.bim to the Calc_Date_T table.
On the Add Column next to CRASH_DATE, select the first cell and enter the formula to return the year from the date:
=YEAR(Calc_Date_T[CRASH_DATE])
Once you have done this, press Enter:

In this recipe, you added a new calculated column to the Calc_Date_T table to show the year for each record. You passed the date to the YEAR function and it returned the 4-digit year as the output. Using this method, you can create the columns required to build a hierarchy for your uses to leverage.