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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
moon_walker
Helper I
Helper I

Availability - how to join Calendar table to operating/online hours table?

Hello, I am trying to calculate the availability/uptime of applications. But each application has its own online hours.

Essentially, an application in our company does not have to be online 24/7, and an outage is only recorded if it occurred during the app's online hours.

 

My Online Hours file has the weekly schedule for each app, according to the day of the week.

e.g.

ScheduleDay of Week NumDay of WeekStart TimeEnd TimeOnline Minutes
App A Schedule1Mon6:00am12:00am1080
App A Schedule2Tue6:00am12:00am1080
App A Schedule3Wed6:00am12:00am1080
App A Schedule4Thu2:00am4:00am120
App A Schedule4Thu6:00am12:00am1080
App A Schedule5Fri6:00am12:00am1080
App A Schedule6Sat8:00am12:00pm240
App A Schedule7Sun8:00am12:00pm240
App B Schedule1Mon12:00am12:00am1440
App B Schedule2Tue12:00am12:00am1440
App B Schedule3Wed12:00am12:00am1440
App B Schedule4Thu12:00am12:00am1440
..................

 

In the above table, notice how Application A is not expected to be online all the time. And, there are two entries for Thursday; it needs to be available 2am-4am, as well as 6am-midnight like the other days. In contrast, Application B is expected to be online all the time.

 

I have a Calendar table using CALENDARAUTO(10), with various columns.

Calendar = ADDCOLUMNS(
CALENDARAUTO(10),
"Year", Year([Date]),
"MonthNo", MONTH([Date]),
"Month", FORMAT([Date], "MMM"),
"DayOfWeekNo", WEEKDAY([Date], 2),
"DayOfWeek", FORMAT([Date],"DDD"),
"Day", DAY([Date]),
"MMM-YYYY", FORMAT([Date],"MMM-YYYY")
)
 
I would like to create time series reports on the individual applications and their availability. I'm thinking that these two tables have to be merged together? But I'm not sure.
I have a third table that has the outages.
 
If these two tables have to be joined, for any given date in the calendar, the table will have the summed online hours for App A, App B, App C, and so on. 
e.g. for Thursday March 3rd 2022, App A online hours are 1200 minutes (120 + 1080), App B online hours are 1440 minutes.
e.g.
DateScheduleDay of Week NumDay of WeekOnline Minutes
Feb 28 2022App A Schedule1Mon1080
Feb 28 2022App B Schedule1Mon1440
Mar 1 2022App A Schedule2Tue1080
Mar 1 2022App B Schedule2Tue1440
Mar 2 2022App A Schedule3Wed1080
Mar 2 2022App B Schedule3Wed1440
Mar 3 2022App A Schedule4Thu1200
Mar 3 2022App B Schedule4Thu1440
Mar 4 2022App A Schedule5Fri1080
Mar 4 2022App B Schedule5Fri1440
...............
 
Is something like this possible? Is this even the right approach? Or should I keep the tables separate to calculate the availability?
Thank you for all your help!
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@moon_walker 

I don't think you can join the schedule to the calendar but we can use TREATAS to move the day of the week filter to get what I think you are looking for.

jdbuchanan71_0-1646253059934.png

I have attached my sample file for you to look at.

 

View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

@moon_walker 

I don't think you can join the schedule to the calendar but we can use TREATAS to move the day of the week filter to get what I think you are looking for.

jdbuchanan71_0-1646253059934.png

I have attached my sample file for you to look at.

 

Wow! This does appear to work correclty. Thank you so much! Had no idea about TREATAS.

littlemojopuppy
Community Champion
Community Champion

Hi @moon_walker here's a link to an article about how to use date and time tables.  Maybe this'll help 🙂

Thank you! This looks pretty interesting, gonna have to study it more. I think it might come in handy.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors