Forum Discussion

chydewf1's avatar
chydewf1
Frequent Visitor
8 years ago
Solved

Create an Uptime Column

Hi    I have the following data set.    I am trying to plot uptime for each calendar month.   ie the total of minutes in a calendar month - the sum of the down time in a given calendar month. ...
  • SteveCampbell's avatar
    8 years ago

    You could create a date table
    Date =  CALENDARAUTO() 

     

    then add a month column:
    Month = Month(Date[Date])

     

    A better practice would be to split the date and time into two columns, one with only the date and one with only the time.

     If you are confident about data integrirty, you can make two new columns in the table containing CREATED and DOWNTIME:

     

    Date Only = 'Table 1'[Created]

    Change the DATA TYPE of this column to "Date" ( NOT date/Time).

     

    Time Only = 'Table 1'[Created]

    Change the DATA TYPE of this column to "Time" ( NOT date/Time).

     

    Join DATE ONLY to the DATE column in the date table.

     

     

     

    You can then create the measure (1440 minutes in a day):

    Uptime :=
    CALCULATE ( COUNT ( 'Date'[Date] ) * 1440 )
        - CALCULATE ( SUM ( Table1[Downtime (mins)] ) )

     

    You can use the month column and uptime column to get the results you need.

  • SteveCampbell's avatar
    SteveCampbell
    8 years ago

    Sorry, This was not clear.

     

     

    Beacause your created has time, it cannot be joined to a date table (1/1/18 05:00:00 AM is different to 1/1/18). This new column will return just the date, ignoring the time factor, so it can be joined to a date table.

     

    A better practice would be to split the date and time into two columns, one with only the date and one with only the time.

     

    If you are confident about data integrirty, you can make two new columns in the table containing CREATED and DOWNTIME:

     

    Date Only = 'Table 1'[Created]

    Change the DATA TYPE of this column to "Date" ( NOT date/Time).

     

    Time Only = 'Table 1'[Created]

    Change the DATA TYPE of this column to "Time" ( NOT date/Time).

     

    Join DATE ONLY to the DATE column in the date table.

     

     

    By seperating, you can also analyze most comon times it goes down. I'll update my solution too.