Adding a calculated column
Calculations contain code that is applied to all rows in your data. You will create calculations to make the data easier for your users to use. In this recipe, you will add a function to create a new date column to your model.
Getting ready
The data that was imported has the CRASH_DATE column formatted as a text field. In order to use this field for calculations, you need the CRASH_DATE column to be formatted as a date data type. You can create a new column and use the built-in functions to achieve this result.
How to do it...
- From the design mode view on the Crash_Data tab, scroll to the end of the columns until you see Add Column.
- Next you need to create a new column based on the CRASH_DATE column that is formatted as a date data type. This new column will be used later to create a relationship with the calendar table. Select Add Column and in the function box enter:
      =LEFT(Crash_Data[CRASH_DATE],10)
- Press Enter.
- The formula...