This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Time-based analysis is at the heart of business intelligence. Whether you're comparing sales from two years ago, analyzing last month’s performance, or calculating totals for the current quarter, time intelligence is essential. While Power BI has long supported time-based calculations, existing functions come with limitations:
Introducing calendar-based time intelligence—a powerful and flexible way to work with any calendar structure in Power BI.
In Power BI, calendars define which columns in a table represent specific time attributes, enabling customized time-based analysis. You can define multiple calendars on any table, giving you full control over how time is segmented and analyzed.
To enable the preview:
Turn_on_Enhanced_DAX_Time_Intelligence
Once enabled, you can define calendars using either the Calendar options UI or the TMDL view.
Access the Calendar options via the Table tools tab or by right clicking a table in the Data pane.
You_can_access_the_Calendar_options_screen_from_the_Table_tools_ribbon
The_Calendar_options_dialog_shows_any_existing_calendars_on_the_table_and_allows
From here, you can:
A calendar consists of mappings between categories and columns. Each category requires a primary column and may include associated columns. For example, a Fiscal Calendar might define:
Editing_a_calendar
Power BI doesn’t require specific languages or formats—what matters is the cardinality between columns.
To learn more in our documentation.
Before saving a calendar, ensure:
Use the Validate data button to check for blank values and cardinality issues.
The TMDL view offers more flexibility, including the ability to tag columns as time related. Here’s a sample snippet:
table Date...
calendar 'Demo Calendar'
lineageTag: def
calendarColumnGroup = year
primaryColumn: Year
calendarColumnGroup = month
primaryColumn: Month
associatedColumn: DutchMonthName
associatedColumn: MonthName
column: 'Holiday Name'
column: isWorkingDay
The Demo Calendar defines the following mappings:
Note that you can also identify columns as time-related, but you can only do that using the TMDL view at this time, as this option is not yet available in the calendar options. Context on any columns that are assigned to the time-related category is removed when performing calculations in all functions except DATEADD and SAMEPERIODLASTYEAR.
We recommend you map only the columns in your table that you want to use in time intelligence calculations. Any context on columns that are part of the table on which the calendar is defined but aren't mapped in that calendar is kept.
Once defined, calendars can be referenced in all time intelligence functions.
Existing time intelligence functions have been updated to work with calendars. For example, here is how to calculate the full last year’s quantity using PARALLELPERIOD:
FullLastYearQuantity =CALCULATE ( [Total Quantity], PARALLELPERIOD ( 'Gregorian', -1, YEAR ) )
Here’s how to calculate a total week-to-date value for the Total Sales measure:
Total Sales WTD = TOTALWTD ( [Total Sales], ISO-454 )
This assumes the ISO-454 calendar indeed defines complete and/or partial week categories such as Week or WeekofMonth.
Additionally, functions that expect a period value also accept WEEK:
FullLastWeekQuantity =CALCULATE ( [Total Quantity], PARALLELPERIOD ( 'Gregorian', -1, WEEK ) )
Calendar-based time intelligence gives you unmatched flexibility and is the only way to perform week-based calculations using built-in functions. Enable the preview today and explore the possibilities! Learn more in our documentation and let us know what you think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.