Preparing the Date Dimension via the Query Editor
In some BI environments, it is not feasible to alter the source date table as per the previous recipe or even modify the SQL view used to load the date dimension table. In these situations, Power BI Desktop's Query Editor and M expressions can serve as an effective alternative to deliver the same columns necessary to drive robust date intelligence analysis.
In this recipe, an example date dimension M query is shared that builds common date attributes as well as dynamic logical columns. Additionally, a process for adding sequential date intelligence columns via M expressions is also included.
Getting ready
To prepare for this recipe:
- Download
CH6_DateTable.xlsx
from the following GitHub repository: https://github.com/PacktPublishing/Microsoft-Power-BI-Cookbook-Second-Edition
How to Prepare the Date Dimension
To implement this recipe, perform the following steps:
- Create a new Power...