DAX Calendar Specific Measure

Modified on Sun, 26 Jul at 4:36 AM

Overview

Calendar Specific Measures calculate defined time periods for financial statements, detail data models, single-value tiles, and period comparisons.

Common Uses

  • Traditional Financial Statements: Current Period-to-Date, Last Month, and Previous Year-to-Date.
  • Sales, Inventory, and Other Detail Data Models: Current Quarter-to-Date and Sales Last 60 Days.
  • Single-Tile Metrics: Sales Yesterday.
  • Comparisons: Current Month-to-Date beside Previous Year Month-to-Date.

Calendar Pattern Compared with Calendar Specific Measures

Measure TypePurpose
Calendar Pattern MeasuresCover complete repeating periods such as Year, Quarter, Month, or Week.
Calendar Specific MeasuresAggregate data through a configured Today Date, such as Year-to-Date or Month-to-Date, or calculate one specific complete period such as Current Month, Last Month, or Previous Year Month.

Today Date

The Today Date used by these measures is configured in the QQube Configuration Tool.

Common Calendar Specific Measures

These measures appear in most QQube data models. Most use Transaction Date, while Vehicle Mileage uses Trip End Date and Payroll uses Effective Payroll Date.

Antecedent Measures

MeasureDefinition
Last MonthFull month previous to current month; current month is based upon Today's date.
Last Month-to-DateMonth-to-date previous to current month; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Last QuarterFull quarter previous to current quarter; current quarter is based upon Today's date.
Last Quarter-to-DateQuarter-to-date previous to current quarter; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Last WeekFull week previous to current week; current week contains Today's date.
Last Week-to-DateWeek-to-date previous to current week; to-date represents the same weekday as Today's date.

Current Measures

MeasureDefinition
Current MonthFull month with the current month containing Today's date.
Current Month-to-DateMonth through Today's date.
Current QuarterFull quarter actual amount with the current quarter containing Today's date.
Current Quarter-to-DateQuarter through Today's date.
Current WeekFull week with the current week containing Today's date.
Current Week-to-DateWeek through Today's date; Sunday is day one.
Current YearFull year with the current year containing Today's date.
Current Year-to-DateYear through Today's date.
Current Year-to-Last MonthYear through the end of the month previous to the current month; current month is based upon Today's date.

Previous Year Measures

MeasureDefinition
Previous YearFull year previous to current year; current year contains Today's date.
Previous Year Last MonthFull month, 13 months previous to current month; current month is based upon Today's date.
Previous Year Last QuarterFull quarter, 5 quarters previous to current quarter; current month is based upon Today's date.
Previous Year MonthFull month, 12 months previous to current month; current month is based upon Today's date.
Previous Year Month-to-DateMonth-to-date 12 months previous to current month-to-date; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Previous Year QuarterFull quarter, 4 quarters previous to current quarter; current quarter contains Today's date.
Previous Year Quarter-to-DateQuarter-to-date 12 months previous to current quarter-to-date; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Previous Year-to-DateYear-to-date 12 months previous to current year-to-date; to-date represents the same weekday as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Previous Year-to-Last MonthFull month 13 months previous to current month; current month is based upon Today's date.

Today, Tomorrow, and Yesterday

MeasureDefinition
TodayToday's date.
TomorrowToday's date plus 1 day.
YesterdayToday's date minus 1 day.

Extended Future Date Measures

These measures can be used with future-oriented dates such as:

  • Expected Date for Open Purchase Orders.
  • Ship Date for Open Sales Orders.
  • Pending Builds.
MeasureDefinition
Next MonthFull month previous to current month; current month is based upon Today's date.
Next QuarterMonth-to-date previous to current month; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Next WeekFull quarter previous to current quarter; current quarter is based upon Today's date.
Next Two WeeksQuarter-to-date previous to current quarter; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.
Next Year

Inventory-Specific Measures

The following Calendar Specific Measures are used in the Inventory data model.

Sales Order — Original and Initial Invoiced

MeasureDefinition
Last 30 DaysFull month previous to current month; current month is based upon Today's date.
Last 365 DaysMonth-to-date previous to current month; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.

Sales

MeasureDefinition
Last 30 DaysFull quarter previous to current quarter; current quarter is based upon Today's date.
Last 60 DaysQuarter-to-date previous to current quarter; to-date represents the same day as Today's date. If the requested date is past the last day of the corresponding month, the last day of the month is returned.

DAX Examples

Current Month Actual

Current Month Actual = IF ( [[DAXP]] ShowValueForDates], VAR todayselection = [[DAXP]] Today Selection] VAR LastMonthAvailable = CALCULATE ( MAX ( 'Calendar'[Year Month Number] ), 'Calendar'[Date] = todayselection ) VAR Result = CALCULATE ( [.Hierarchy Actual], ALLEXCEPT ( 'Calendar', 'Calendar'[Day Holiday Name], 'Calendar'[Day is Working Day], 'Calendar'[Day of Week Abbr] ), 'Calendar'[Year Month Number] = LastMonthAvailable, ALL ( 'Calendar' ) ) RETURN Result )

Current Month-to-Date Actual

Current Month-to-Date Actual = IF ( [[DAXP]] ShowValueForDates], VAR todayselection = [[DAXP]] Today Selection] VAR LastMonthAvailable = CALCULATE ( MAX ( 'Calendar'[Year Month Number] ), 'Calendar'[Date] = todayselection ) VAR Result = CALCULATE ( [.Hierarchy Actual], ALLEXCEPT ( 'Calendar', 'Calendar'[Day Holiday Name], 'Calendar'[Day is Working Day], 'Calendar'[Day of Week Abbr] ), 'Calendar'[Year Month Number] = LastMonthAvailable, 'Calendar'[SequentialDayNumber] <= todayselection, ALL ( 'Calendar' ) ) RETURN Result )

Filter-Safe Calendar Columns

Three calendar columns are always preserved regardless of other filters applied to a measure:

  • 'Calendar'[Day Holiday Name]
  • 'Calendar'[Day is Working Day]
  • 'Calendar'[Day of Week Abbr]

Version 10 Addition

'Calendar'[Day is Working Day] was added in QQube Version 10.

Expected Result

Calendar Specific Measures provide ready-to-use calculations for current, prior, future, and rolling periods while respecting the Today Date configured in QQube.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article