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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
davidturk
Frequent Visitor

Service Availability Help

I'd like to report on service availability, reposting my late reply as my thread was closed. see the closed thread here: https://community.powerbi.com/t5/Desktop/Need-help-removing-ignoring-double-counting-of-data/m-p/198...

 

OutageServiceGroupStartEnd
1s1g16/7/21 12:00:006/7/21 13:00:00
2s1g16/7/21 12:30:006/7/21 13:00:00
3s1g16/7/21 12:22:006/7/21 12:44:00
4s1g16/9/21 13:00:006/9/21 14:00:00
5s2g16/7/21 12:00:00 6/7/21 13:00:00

 

I believe the provided calculation will show downtime all the way from 6/7/21 12:00:00 through 6/9/21 14:00:00 when 's1' has only been down for two hours total. Further, now let's say we want to call these two services a group. I like to be able to also report availability / non-overlapping total down time of the group as well as each individual service.

1 ACCEPTED SOLUTION

Hi @davidturk ,

 

1.Create a new calculated column as follows

 

 

Date = [Start].[Date]

 

 

14.png

 

2.Then create the following calculated column

 

 

Actual Seconds by Service = 
VAR _minStart =
    MINX (
        FILTER (
            'Table',
            [Service] = EARLIER ( [Service] )
                && [Date] = EARLIER ( [Date] )
        ),
        [Start]
    )
VAR _minEnd =
    MAXX ( FILTER ( 'Table', 'Table'[Start] = _minStart ), [End] )
RETURN
    SWITCH (
        TRUE (),
        [Start] = _minStart
            && [End] = _minEnd, DATEDIFF([Start],[End],SECOND),
        [Start] >= _minStart
            && [End] <= _minEnd, 0
    )
Actual Seconds by Group = 
VAR _minStart =
    MINX (
        FILTER ( 'Table', [Date] = EARLIER ( [Date] ) && [Group] = EARLIER ( [Group] ) ),
        [Start]
    )
VAR _minEnd =
    MAXX ( FILTER ( 'Table', [Start] = _minStart ), [End] )
VAR _id =
    MINX ( FILTER ( 'Table', [Start] = _minStart && [End] = _minEnd ), [Outage] )
RETURN
    SWITCH (
        TRUE (),
        [Start] = _minStart
            && [End] = _minEnd
            && [Outage] = _id, DATEDIFF ( [Start], [End], SECOND ),
        [Start] >= _minStart
            && [End] <= _minEnd, 0
    )

 

 

1.png

5.png

 

3.In the report view, you can create table visuals to view

2.png

 

 

Best Regards,

Stephen Tao

 

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

 

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @davidturk ,

 

Why is there only two hours between 6/7/21 12:00:00 and 6/9/21 14:00:00? , Is your number of days wrong? It’s June 7th instead of June 9th.

What is your expected result? Please show the expected results in the form of a table.

 

Best Regards,

Stephen Tao

 

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

S1 has 1 hour of total outage between 7/21 12:00 and 13:00. There are three outages in this window, but I want to ignore overlapping times in the results to get a "true" outage total time. It has another 1 hour of outage between 6/9 13:00 and 14:00, for a total of 2 hours of total outage time.

 

S2 has 1 hour of total outage time between 6/7 12:00 and 13:00.

 

The measure provided in the original thread to me worked fine before I added the row to my example for 6/9, but aftward it reports that the service is experiencing an outage for almost 2 days. Basically, as long as all the outages are clustered and contiguous in time, it works fine, but not if they're spread into different clusters.

 

I also want to be able to group them and get the correct, non-overlapping outage total time:

 

ServiceOutageTime (seconds)
s17200
s23600

 

GroupOutageTime (seconds)
g17200

Hi @davidturk ,

 

1.Create a new calculated column as follows

 

 

Date = [Start].[Date]

 

 

14.png

 

2.Then create the following calculated column

 

 

Actual Seconds by Service = 
VAR _minStart =
    MINX (
        FILTER (
            'Table',
            [Service] = EARLIER ( [Service] )
                && [Date] = EARLIER ( [Date] )
        ),
        [Start]
    )
VAR _minEnd =
    MAXX ( FILTER ( 'Table', 'Table'[Start] = _minStart ), [End] )
RETURN
    SWITCH (
        TRUE (),
        [Start] = _minStart
            && [End] = _minEnd, DATEDIFF([Start],[End],SECOND),
        [Start] >= _minStart
            && [End] <= _minEnd, 0
    )
Actual Seconds by Group = 
VAR _minStart =
    MINX (
        FILTER ( 'Table', [Date] = EARLIER ( [Date] ) && [Group] = EARLIER ( [Group] ) ),
        [Start]
    )
VAR _minEnd =
    MAXX ( FILTER ( 'Table', [Start] = _minStart ), [End] )
VAR _id =
    MINX ( FILTER ( 'Table', [Start] = _minStart && [End] = _minEnd ), [Outage] )
RETURN
    SWITCH (
        TRUE (),
        [Start] = _minStart
            && [End] = _minEnd
            && [Outage] = _id, DATEDIFF ( [Start], [End], SECOND ),
        [Start] >= _minStart
            && [End] <= _minEnd, 0
    )

 

 

1.png

5.png

 

3.In the report view, you can create table visuals to view

2.png

 

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.