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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EduardoMagalhae
Regular Visitor

Calculate Uptime (in %) of a System, based on Downtime Events

Hi there

 

I'm new to this, so I hope I am doing it right! 🙂 

 

I have a table with Downtime events of my system. It looks like this:

 

Screenshot 2021-12-15 090331.pngNow I want to disply the Uptime in % based on a time reference, using a filter for dates or fixed period for example:

 

With a data filter from 08.11.21 and 12.12.21 the Uptime was XX.X %

 

Or, on a table:

 

Oct: 21: xx%

Nov 21: xx%

Dec 21: xx% 

 

Or...

2021: xx%

2022: xx%

 

Or...

 

Calendarweek 34: xx%

Calendarweek 35: xx%

Calendarweek 36: xx%

 

 

I already have a Table (for other purposes) with Timeslots divided by hour, if this help. It looks like this:

Screenshot 2021-12-15 090853.png

This table is autogenerated with a python script from 01.01.21 up to Today + 5 days. 

 

 

 

 

 

 

 

 

 

 

 

I think I have to use DAX for it but I'm not sure how.... 

2 ACCEPTED SOLUTIONS

This was actually a fun challenge - thank you.  See my proposal attached.  You can modify the calendar table as needed.

Edit:  I think the value across towers is incorrect but I am not sure how you want this represented.  If  one of the seven towers is down do the other ones still report 100% uptime?

View solution in original post

lbendlin
Super User
Super User

This formula might be slightly "better":

Uptime% = 
var t = countrows(ALLSELECTED('Table'[tower_id]))
return if ( hasonevalue('Table'[tower_id])
,DIVIDE([DaysinPeriod]*1440-sum('Table'[down_minutes]),[DaysinPeriod]*1440,1)
,DIVIDE([DaysinPeriod]*1440*t-sum('Table'[down_minutes]),[DaysinPeriod]*1440*t,1))

View solution in original post

12 REPLIES 12
lbendlin
Super User
Super User

This formula might be slightly "better":

Uptime% = 
var t = countrows(ALLSELECTED('Table'[tower_id]))
return if ( hasonevalue('Table'[tower_id])
,DIVIDE([DaysinPeriod]*1440-sum('Table'[down_minutes]),[DaysinPeriod]*1440,1)
,DIVIDE([DaysinPeriod]*1440*t-sum('Table'[down_minutes]),[DaysinPeriod]*1440*t,1))

This is really good. The only issue, when it a 100% instead of getting 100% I get 100.76%... I think is a rounding error. HOw'd go about to rounding it down? 

I don't see that in the sample data. Please provide sanitized sample data that fully covers your issue. 

EduardoMagalhae
Regular Visitor

DAX, if possible and Minute granularity is perfect. 

This was actually a fun challenge - thank you.  See my proposal attached.  You can modify the calendar table as needed.

Edit:  I think the value across towers is incorrect but I am not sure how you want this represented.  If  one of the seven towers is down do the other ones still report 100% uptime?

This was awesome and solved my issue. I worked for a software company and we are creating a report for uptime by SLA categories. I was worried when adding various filters (specific client, product, severity etc etc)  that the uptime % would be incorrect. I used your example provided and it has worked almost entirely across the board. One minor issue I am still trying to figure out but otherwise so helpful!! 

Sorry for the delay. Cought Covid. 😞

This looks really good already, but I am having trouble replicating it in my main table. First I create the Table Dates (and it creates the Date column automatically). When I try to create the Month, Quarter, Week and Year Table it gives me the error:  A single value for column 'Date' in table 'Dates' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Do you know why it would tell me that?

My proposed solution already has a Calendar table.  Modify it as needed, don't create a new one.

EduardoMagalhae
Regular Visitor

Just Did above. 

You want the solution in Power Query or in DAX?

EduardoMagalhae
Regular Visitor

Here you go! 

 

Tower is the ID of the facility, or machine that is donw. Start and End is the slot that got mesured. The down time show  how many minute in that slot the machine was down. 

 

I have to asume, that, if there is nothing on this table, the tower is online. 

 

 

tower_idTimeSlotStartTimeSlotEnddown_minutes
509/11/2021 10:00:0009/11/2021 10:59:0060
509/11/2021 11:00:0009/11/2021 11:59:0060
509/11/2021 12:00:0009/11/2021 12:59:0060
509/11/2021 13:00:0009/11/2021 13:59:0060
509/11/2021 15:00:0009/11/2021 15:59:0060
614/12/2021 11:00:0014/12/2021 11:59:0060
108/11/2021 17:00:0008/11/2021 17:59:0045
109/11/2021 02:00:0009/11/2021 02:59:0031
208/11/2021 17:00:0008/11/2021 17:59:0043
218/11/2021 23:00:0018/11/2021 23:59:0057
212/12/2021 09:00:0012/12/2021 09:59:0023
212/12/2021 12:00:0012/12/2021 12:59:0023
212/12/2021 18:00:0012/12/2021 18:59:0015
213/12/2021 04:00:0013/12/2021 04:59:0033
508/11/2021 17:00:0008/11/2021 17:59:0021
509/11/2021 14:00:0009/11/2021 14:59:0038
308/11/2021 17:00:0008/11/2021 17:59:0049
309/11/2021 23:00:0009/11/2021 23:59:004
322/11/2021 15:00:0022/11/2021 15:59:002
323/11/2021 02:00:0023/11/2021 02:59:001
323/11/2021 16:00:0023/11/2021 16:59:0038
325/11/2021 23:00:0025/11/2021 23:59:001
714/12/2021 11:00:0014/12/2021 11:59:0055
714/12/2021 13:00:0014/12/2021 13:59:0050
614/12/2021 10:00:0014/12/2021 10:59:0020
614/12/2021 12:00:0014/12/2021 12:59:0054
614/12/2021 12:00:0014/12/2021 12:59:001
614/12/2021 13:00:0014/12/2021 13:59:0010
614/12/2021 13:00:0014/12/2021 13:59:0044
408/11/2021 17:00:0008/11/2021 17:59:0047
409/11/2021 23:00:0009/11/2021 23:59:004
422/11/2021 16:00:0022/11/2021 16:59:0055
423/11/2021 02:00:0023/11/2021 02:59:002
423/11/2021 15:00:0023/11/2021 15:59:009
425/11/2021 23:00:0025/11/2021 23:59:001
lbendlin
Super User
Super User

Please provide sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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