Forum Discussion
uptime
- 4 years ago
Hello ryan_mayu here is the sample data. desired outcome is
1. %up time
2.%downtime
3.up time hours
4.downtime hours
thank you
Name DateTime Duration Status A 1/10/2021 10:29 59 Up A 1/10/2021 10:30 478957 Up A 12/10/2021 22:45 3894 Down A 12/10/2021 23:50 145046 Up B 1/10/2021 10:30 37 Up B 1/10/2021 10:30 479099 Up B 12/10/2021 22:41 4195 Down B 12/10/2021 23:51 144955 Up C 11/10/2021 15:23 37 Up C 11/10/2021 15:24 112805 Up C 12/10/2021 22:44 3895 Down C 12/10/2021 23:49 145159 Up D 11/10/2021 15:24 37 Up D 11/10/2021 15:24 112805 Up D 12/10/2021 22:44 3895 Down D 12/10/2021 23:49 144943 Up - 4 years ago
Hi, jaipal
here goes your solution, if your Duration is in second:
Four measures:Uptime = 1 - (SUMX(FILTER('Table','Table'[Status]="Down"),'Table'[Duration]) / (SUMX(FILTER('Table','Table'[Status]="Up"),'Table'[Duration]))) Downtime = SUMX(FILTER('Table','Table'[Status]="Down"),'Table'[Duration]) / (SUMX(FILTER('Table','Table'[Status]="Up"),'Table'[Duration])) UptimeHours = (SUMX(FILTER('Table','Table'[Status]="Up"),'Table'[Duration]))/60/60 DowntimeHours = (SUMX(FILTER('Table','Table'[Status]="Down"),'Table'[Duration]))/60/60 - 4 years ago
I am glad it's working, if you could Kudo my original message, so this threat is marked as Solved.
jaipal Many thanks
Hello ryan_mayu here is the sample data. desired outcome is
1. %up time
2.%downtime
3.up time hours
4.downtime hours
thank you
| Name | DateTime | Duration | Status |
| A | 1/10/2021 10:29 | 59 | Up |
| A | 1/10/2021 10:30 | 478957 | Up |
| A | 12/10/2021 22:45 | 3894 | Down |
| A | 12/10/2021 23:50 | 145046 | Up |
| B | 1/10/2021 10:30 | 37 | Up |
| B | 1/10/2021 10:30 | 479099 | Up |
| B | 12/10/2021 22:41 | 4195 | Down |
| B | 12/10/2021 23:51 | 144955 | Up |
| C | 11/10/2021 15:23 | 37 | Up |
| C | 11/10/2021 15:24 | 112805 | Up |
| C | 12/10/2021 22:44 | 3895 | Down |
| C | 12/10/2021 23:49 | 145159 | Up |
| D | 11/10/2021 15:24 | 37 | Up |
| D | 11/10/2021 15:24 | 112805 | Up |
| D | 12/10/2021 22:44 | 3895 | Down |
| D | 12/10/2021 23:49 | 144943 | Up |
do you want to calculate overall %up/ down time? or the percentage for each name?
how to calculate the hours?Using the duration? is the duration seconds or minutes?
- jaipal4 years agoResolver III
I need overall %uptime and %downtime for month. and each name as well
and need to calculate duration based on duration, and yes duration is in seconds.
- vojtechsima4 years agoSuper User
Uptime = var Uptime = CALCULATE( 1 - (SUMX(FILTER('Table','Table'[Status]="Down"),'Table'[Duration]) / (SUMX(FILTER('Table','Table'[Status]="Up"),'Table'[Duration]))), FILTER('Table','Table'[DateTime].[MonthNo]<=MAX('Table'[DateTime].[MonthNo])) ) var Check = IF(ISBLANK(Uptime),1, Uptime) Return Check Downtime = var Downtime = CALCULATE( SUMX(FILTER('Table','Table'[Status]="Down"),'Table'[Duration]) / (SUMX(FILTER('Table','Table'[Status]="Up"),'Table'[Duration])), FILTER('Table','Table'[DateTime].[MonthNo]<=MAX('Table'[DateTime].[MonthNo])) ) var Check = IF(ISBLANK(Downtime),0, Downtime) Return Check UptimeHours = CALCULATE( (SUMX(FILTER('Table','Table'[Status]="Up"),'Table'[Duration])/60/60), FILTER('Table','Table'[DateTime].[MonthNo]<=MAX('Table'[DateTime].[MonthNo]))) DowntimeHours = CALCULATE((SUMX(FILTER('Table','Table'[Status]="Down"),'Table'[Duration]))/60/60, FILTER('Table','Table'[DateTime].[MonthNo]<=MAX('Table'[DateTime].[MonthNo])))