16.1How time functions work

Comparing a month with the one before, or a year with the previous year, is probably what you will be asked for most often. Time functions answer these questions, thanks to the date table you met at the very start of the course.

16.1.1They supply dates

A time function like SAMEPERIODLASTYEAR calculates no number. It returns a table of dates, for example the same days one year earlier. CALCULATE then uses it as a filter:

CALCULATE( [Revenue], SAMEPERIODLASTYEAR( Calendar[Date] ) )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table

It is the same mechanism as ALL. A function supplies a table, and CALCULATE replaces the filter on the dates with it.

The rest of this lesson is part of izyDAX Pro

You have just read the first section. The next 2, their animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.