Creating calculated columns
When creating DAX formulas, there are two ways to apply them to the model. The first is to create a calculated column. When you add a calculated column to the model, it applies the function on a row-by-row basis. For example, if you want to parse the datetime format of a table to only show the current year, adding a new calculated column would evaluate the formula on the date column and add it to a new column on the table evaluated once for each row in the table. When the data is refreshed, the formula is evaluated on the table and no user interaction is required for the formula to be applied to its context.
How to do it...
Open Visual Studio and the tabular model project.
On the CRASH_DATA_T table, review the CRASH_DATE column. It is a Date column that includes a timestamp.
Scroll to the end of the CRASH_DATA_T table and enter the DAX expression to parse the year from the Crash_date column:
=YEAR(CRASH_DATA_T[CRASH_DATE])
The tabular engine will now immediately...