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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
_rocklicker_
New Member

Binary Runtime/Downtime Visualization

I have a data set similar to the table below with a machine ID, and columns for start and end of downtime periods. Machines may or may not have multiple records for downtime intervals. I'd like to be able to have a binary visual similar to the below paint mockup showing date along x axis and the status of the machine as either "up/running" or "down" . I figure a calendar table is in order but struggling with how to transform/join the data to get the desired result for visualization - essentially if a given date is between a start/end date for a given machine it's a 0 (down) and if it's not it's a 1 (up) for that machine.

Tried searching the forums but haven't found quite the result I'm looking for, please let me know if I missed a solution (first time posting on here)

MachineIDDowntimeStartDowntimeEnd
11-May1-Jul
11-Jan1-Feb
21-Jan1-Mar
21-Sep5-Sep
31-Apr4-Apr
48-May31-May
41-Mar5-Mar

_rocklicker__1-1626310065533.png

 

 

 

2 ACCEPTED SOLUTIONS
Vera_33
Resident Rockstar
Resident Rockstar

Hi @_rocklicker_ 

 

Here is one way, Date from a connected Date Table, test measure as below

Vera_33_0-1626327560127.png

test = 
VAR CurDate = MAX('Date'[Date])
VAR T1 = SELECTCOLUMNS(GENERATE('Table',DATESBETWEEN('Date'[Date],'Table'[DowntimeStart],'Table'[DowntimeEnd])),"Dates",[Date])
RETURN
IF(CurDate in T1, 0, 1)

 

View solution in original post

v-deddai1-msft
Community Support
Community Support

Hi @_rocklicker_ ,

 

You can use power query to expand all dates from start date and end date:

Capture9.PNG

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k1MzsjMS/V0UdJRcskvzyvJzE0NLkksKkHiu+alKMXqRCsZAsUMdX0TK8G0V2kOkqhXYh6YdktNAosaoYj6JhYhiQanFgBpUzANEjUGizoWFAFpEzANEjUB8iygthlDrIUJQwwEGQE2OBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"MachineID", Int64.Type}, {"DowntimeStart", type date}, {"DowntimeEnd", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each {Number.From([DowntimeStart])..Number.From([DowntimeEnd])}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Changed Type2" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type date}})
in
    #"Changed Type2"

Then use the following measure:

 

Measure = IF(MAX('Date'[Date]) IN VALUES('Table'[Custom]),0,1)

 

Capture10.PNG

 

For more details, please refer to the pbix file. 

 

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

 

Best Regards,

Dedmon Dai

 

 

 

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @_rocklicker_ ,

 

You can use power query to expand all dates from start date and end date:

Capture9.PNG

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k1MzsjMS/V0UdJRcskvzyvJzE0NLkksKkHiu+alKMXqRCsZAsUMdX0TK8G0V2kOkqhXYh6YdktNAosaoYj6JhYhiQanFgBpUzANEjUGizoWFAFpEzANEjUB8iygthlDrIUJQwwEGQE2OBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"MachineID", Int64.Type}, {"DowntimeStart", type date}, {"DowntimeEnd", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each {Number.From([DowntimeStart])..Number.From([DowntimeEnd])}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Changed Type2" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type date}})
in
    #"Changed Type2"

Then use the following measure:

 

Measure = IF(MAX('Date'[Date]) IN VALUES('Table'[Custom]),0,1)

 

Capture10.PNG

 

For more details, please refer to the pbix file. 

 

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

 

Best Regards,

Dedmon Dai

 

 

 

Vera_33
Resident Rockstar
Resident Rockstar

Hi @_rocklicker_ 

 

Here is one way, Date from a connected Date Table, test measure as below

Vera_33_0-1626327560127.png

test = 
VAR CurDate = MAX('Date'[Date])
VAR T1 = SELECTCOLUMNS(GENERATE('Table',DATESBETWEEN('Date'[Date],'Table'[DowntimeStart],'Table'[DowntimeEnd])),"Dates",[Date])
RETURN
IF(CurDate in T1, 0, 1)

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors