Forum Discussion

rjithesh's avatar
rjithesh
Frequent Visitor
4 years ago
Solved

Monthly uptime calculation

Hi

I have a powerbi table

 

Link detailsDowntime (Min)Month
Link-11000Jun
Link-13230July

I need to calculate monthly uptime of each link....Excel formula is 1-((Downtime in Min)/(No of days in month*24*60))

 

How can calculate in Powerbi ?   Pls help

  • Hi, rjithesh 

     

    You can try the following methods. Create a new date table.

    Table:

    Date = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))

    Column:

    Month = FORMAT([Date],"mmmm")

    No of days in month = 
    CALCULATE (
        COUNT ( 'Date'[Date] ),
        FILTER ( 'Date', [Month] = EARLIER ( 'Table'[Month] ) )
    )
    uptime =
    1
        - DIVIDE ( [Downtime (Min)], [No of days in month] * 24 * 30 )
    

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • rjithesh , Try a measure like

     

    Divide(Sum(Table[Down Time in Min]) , Sumx(Summarize(Table, Table[Link], Table[Month Year], "_1", Day(eomonth(max(Table[Date]),0))) , [_1]))

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, rjithesh 

     

    You can try the following methods. Create a new date table.

    Table:

    Date = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))

    Column:

    Month = FORMAT([Date],"mmmm")

    No of days in month = 
    CALCULATE (
        COUNT ( 'Date'[Date] ),
        FILTER ( 'Date', [Month] = EARLIER ( 'Table'[Month] ) )
    )
    uptime =
    1
        - DIVIDE ( [Downtime (Min)], [No of days in month] * 24 * 30 )
    

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.