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
dumbfound
Frequent Visitor

How to calculate monthly uptime percentage from downtime minutes

Hello PowerBI community,

 

How do I calculate the uptime % per month with the data available below ? Can you please help me think through the DAX here? 

 

What I have 

S.NoDowntime Start DateDowntime MinutesDowntime End Date
11/1/2022504002/5/2022
21/2/2022460802/3/2022
31/3/20221022403/15/2022
41/4/2022288001/24/2022
51/5/2022792003/1/2022
61/6/2022806403/3/2022
71/7/20221108803/25/2022
81/8/2022504002/12/2022

 

What I want to calculate - 

 

S.NoJan (uptime%)Feb (Uptime%)Mar (Uptime %)
1082100
2389100
36052
410100100
513097
616090
719019
82357100

 

Thanks in advance!

@amitchandak @Greg_Deckler  @Jihwan_Kim @lbendlin 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please chech the below picture and the attached pbix file.

 

Jihwan_Kim_1-1669867786171.png

 

Jihwan_Kim_0-1669867747389.png

 

 

Uptime percentage measure: =
VAR _daysinamonth =
    COUNTROWS ( 'Calendar' )
VAR _downstreamdaysinamonth =
    COUNTROWS (
        FILTER (
            'Calendar',
            'Calendar'[Date] >= MAX ( Data[Downtime Start Date] )
                && 'Calendar'[Date] <= MAX ( Data[Downtime End Date] )
        )
    )
VAR _upstreamratio =
    DIVIDE ( _daysinamonth - _downstreamdaysinamonth, _daysinamonth )
RETURN
    IF ( HASONEVALUE ( Data[S.No] ), _upstreamratio )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please chech the below picture and the attached pbix file.

 

Jihwan_Kim_1-1669867786171.png

 

Jihwan_Kim_0-1669867747389.png

 

 

Uptime percentage measure: =
VAR _daysinamonth =
    COUNTROWS ( 'Calendar' )
VAR _downstreamdaysinamonth =
    COUNTROWS (
        FILTER (
            'Calendar',
            'Calendar'[Date] >= MAX ( Data[Downtime Start Date] )
                && 'Calendar'[Date] <= MAX ( Data[Downtime End Date] )
        )
    )
VAR _upstreamratio =
    DIVIDE ( _daysinamonth - _downstreamdaysinamonth, _daysinamonth )
RETURN
    IF ( HASONEVALUE ( Data[S.No] ), _upstreamratio )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.

Top Solution Authors