Tutorial with example
In today’s video I we will go through how to build a time intelligence measure in DAX using the PREVIOUSDAY, PREVIOUSMONTH, PREVIOUSQUARTER, PREVIOUSYEAR.
We will first go through PREVIOUSYEAR DAX function and explain how can those functions can be combined with CALCULATE to create the correct measure.
We move on to PREVIOUSQUARTER DAX functionwhere we go through how to that measure works and create an example.
Next will be PREVIOUSMONTH DAX function where we go through what the “first day in the current context” means.
And finally we go through PREVIOUSDAY DAX example where we go through what happens when we dont have continuous days in our sales table.
Download example file:
This function returns all dates from the previous month, using the first date in the column used as input. For example, if the first date in the dates argument refers to June 10, 2009, this function returns all dates for the month of May, 2009.
The dates argument can be any of the following:
- A reference to a date/time column.
- A table expression that returns a single column of date/time values.
- A Boolean expression that defines a single-column table of date/time values.
This DAX function is not supported for use in DirectQuery mode.