Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Walt1010
Helper V
Helper V

Getting Going with Time Intelligence

I have a file of leave data that has sickness leave data for approximately 2.4 years. I have defined various measures such as total staff, sickness rate and days lost, I need to show the summary metrics for each year (financial plus calendar), in order to compare these measures with government statistics. 

I have 3 main tables, staff, sickleave and a date table. The date table is very basic. The tables are connected to each other.

What do I need to do in order to start using the time intellgence features, just create measures that use the trime intelligence functions?

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@Walt1010 You need to mark your table as a date table for the DAX TI functions to work "reliably". However, I would highly recommend using offsets instead in your date table. Also, have a look at the following. You may find this helpful - https://medium.com/@gdeckler/to-bleep-with-time-intelligence-0b0c2a4708d9 

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

wardy912
Super User
Super User

Hi @Walt1010 

 

If you want to improve your date table for future projects, here's the calendar I always use. Replace the MIN/MAX with dates from your primary data table for dynamic start and end dates

Date = 
ADDCOLUMNS (
    CALENDAR (
        MIN ( [Date column from existing table] ),
        MAX ( [Date column from existing table] )
    ),
    "MonthNo", MONTH ( [Date] ),
    "MonthName", FORMAT ( [Date], "MMMM" ),
    "MonthYear", FORMAT ( [Date], "MMMM YYYY" ),
    "MonthYearShort", FORMAT ( [Date], "MMM YY" ),
    "MonthYearNo", FORMAT ( [Date], "YYYYMM" ),
    "Quarter", QUARTER ( [Date] ),
    "Year", YEAR ( [Date] ),
    "Day", DAY ( [Date] ),
    "WeekNumber", WEEKNUM ( [Date] ),
    "WeekdayNum", WEEKDAY ( [Date] ),
    "WeekdayName", FORMAT ( [Date], "DDDD" ),
    "PreviousWeek", WEEKNUM ( [Date] ) -1 ,
    "WeekStartDate", ([Date] - WEEKDAY ( [Date] , 1 ) +1),
    "WeekEndDate", ([Date] - WEEKDAY ( [Date] , 1 ) +7),
    "YearMonth", FORMAT ( [Date], "YYYY-M" ),
    "Financial Year", IF (MONTH ([Date]) >= 1 && MONTH ([Date]) <= 12, YEAR ([Date]), YEAR ([Date]) + 1)
)

 

Once marked as the date table, you can add a variety of measures, some examples below

 

-- Total Days Lost This Year (Calendar)
DaysLost_CY := CALCULATE([Days Lost], DATESYTD('Date'[Date]))

-- Total Days Lost This Financial Year
DaysLost_FY := CALCULATE([Days Lost], DATESYTD('Date'[Date], "06/30"))

-- Sickness Rate Last Year
SicknessRate_LY := CALCULATE([Sickness Rate], SAMEPERIODLASTYEAR('Date'[Date]))

 

Hope this helps, please give a thumbs up and mark as solved if it does, thanks!

View solution in original post

5 REPLIES 5
v-priyankata
Community Support
Community Support

Hi @Walt1010 

Hope everything’s going smoothly on your end. We haven’t heard back from you, so I wanted to check if the issue got sorted. if you have any other issues please reach community.

 

wardy912
Super User
Super User

Hi @Walt1010 

 

If you want to improve your date table for future projects, here's the calendar I always use. Replace the MIN/MAX with dates from your primary data table for dynamic start and end dates

Date = 
ADDCOLUMNS (
    CALENDAR (
        MIN ( [Date column from existing table] ),
        MAX ( [Date column from existing table] )
    ),
    "MonthNo", MONTH ( [Date] ),
    "MonthName", FORMAT ( [Date], "MMMM" ),
    "MonthYear", FORMAT ( [Date], "MMMM YYYY" ),
    "MonthYearShort", FORMAT ( [Date], "MMM YY" ),
    "MonthYearNo", FORMAT ( [Date], "YYYYMM" ),
    "Quarter", QUARTER ( [Date] ),
    "Year", YEAR ( [Date] ),
    "Day", DAY ( [Date] ),
    "WeekNumber", WEEKNUM ( [Date] ),
    "WeekdayNum", WEEKDAY ( [Date] ),
    "WeekdayName", FORMAT ( [Date], "DDDD" ),
    "PreviousWeek", WEEKNUM ( [Date] ) -1 ,
    "WeekStartDate", ([Date] - WEEKDAY ( [Date] , 1 ) +1),
    "WeekEndDate", ([Date] - WEEKDAY ( [Date] , 1 ) +7),
    "YearMonth", FORMAT ( [Date], "YYYY-M" ),
    "Financial Year", IF (MONTH ([Date]) >= 1 && MONTH ([Date]) <= 12, YEAR ([Date]), YEAR ([Date]) + 1)
)

 

Once marked as the date table, you can add a variety of measures, some examples below

 

-- Total Days Lost This Year (Calendar)
DaysLost_CY := CALCULATE([Days Lost], DATESYTD('Date'[Date]))

-- Total Days Lost This Financial Year
DaysLost_FY := CALCULATE([Days Lost], DATESYTD('Date'[Date], "06/30"))

-- Sickness Rate Last Year
SicknessRate_LY := CALCULATE([Sickness Rate], SAMEPERIODLASTYEAR('Date'[Date]))

 

Hope this helps, please give a thumbs up and mark as solved if it does, thanks!

v-priyankata
Community Support
Community Support

Hi @Walt1010 
@Greg_Deckler Thanks for the inputs.

I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community. if issue resolved please accept it as solution.

 

Hi @Walt1010 

I wanted to check if you had the opportunity to review the information provided by user. Please feel free to contact us if you have any further questions.

Greg_Deckler
Community Champion
Community Champion

@Walt1010 You need to mark your table as a date table for the DAX TI functions to work "reliably". However, I would highly recommend using offsets instead in your date table. Also, have a look at the following. You may find this helpful - https://medium.com/@gdeckler/to-bleep-with-time-intelligence-0b0c2a4708d9 

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.