To prepare for this recipe, perform the following steps:
- Create a table using the following formula:
R01_Calendar = CALENDAR(DATE(2015,1,1),DATE(2022,12,31))
- Create a table called R01_Sales by importing the Sales.csv file from the GitHub repository: https://github.com/PacktPublishing/DAX-Cookbook/tree/master/Chapter02.
- Create a column in the R01_Sales table using the following formula:
Year = YEAR([Date])
- Create another column in the R01_Sales table using the following formula:
Month = FORMAT([Date],"mmmm")
- Create a third column in the R01_Sales table using the following formula:
Month Sort = MONTH([Date])
- Set the Sort by column for Month to Month Sort.
- Create a bidirectional relationship between the Date column in the R01_Sales table and the Date column in the R01_Calendar table.