How it works...

First, it should be noted that this recipe assumes a seven-day work week. If this is not the case for your organization, see the Replacing Excel's NETWORKDAYS function recipe in Chapter 2, Dealing with Dates and Calendars.

We start by setting the start and end of our time period for analysis. This is done by setting the __StartPeriod variable to the minimum Date in the R02_Calendar table currently within the context, as well as setting the __EndPeriod variable to the maximum Date in the R02_Calendar table currently within the context. By setting these variables dynamically based upon the context, this allows the measure to work within any time interval chosen.

We know from our basic formula for absenteeism that we need the ...

Get DAX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.