March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi,
I have a list of downtime events of several machines. Some downtime events are planned and some are unplanned. I want to be able to select a specific planned downtime event, and then to see the next 20 downtime events that occured after the specific planned downtime event that I selected. How can I do this?
Solved! Go to Solution.
Hi, @rebrow31
Try below measure
result =
var a =CALCULATE(
MIN('Table 2'[Value]),
INDEX(
20,
FILTER(ALL('Table 2'[Machine],'Table 2'[Value]),'Table 2'[Value]>=MIN(Datetable[Date])),
ORDERBY('Table 2'[Value],ASC),,
PARTITIONBY('Table 2'[Machine]),
MATCHBY('Table 2'[Machine],'Table 2'[Value])
),
KEEPFILTERS(Datetable[Date])
)
var b= MIN('Table 2'[Value])+DATEDIFF(MIN(Datetable[Date]),a,DAY)
var c = CALCULATE(MAX('Table 2'[Value]),ALL('Table 2'[Value]))
var d= IF(ISBLANK(a),c,a)
var e= IF(ISFILTERED('Table 2'[Value]) && MIN('Table 2'[Value])>=SELECTEDVALUE(Datetable[Date]) && MIN('Table 2'[Value])<=d,1,0)
RETURN
e
i am taking data of machine and date
consider table2[value] as your downtime date column
if after selected date you have less then 20 downtime field it also show that
see below image
use measure in visual level filter
you can download file from below
Hi, @rebrow31
Try below measure
result =
var a =CALCULATE(
MIN('Table 2'[Value]),
INDEX(
20,
FILTER(ALL('Table 2'[Machine],'Table 2'[Value]),'Table 2'[Value]>=MIN(Datetable[Date])),
ORDERBY('Table 2'[Value],ASC),,
PARTITIONBY('Table 2'[Machine]),
MATCHBY('Table 2'[Machine],'Table 2'[Value])
),
KEEPFILTERS(Datetable[Date])
)
var b= MIN('Table 2'[Value])+DATEDIFF(MIN(Datetable[Date]),a,DAY)
var c = CALCULATE(MAX('Table 2'[Value]),ALL('Table 2'[Value]))
var d= IF(ISBLANK(a),c,a)
var e= IF(ISFILTERED('Table 2'[Value]) && MIN('Table 2'[Value])>=SELECTEDVALUE(Datetable[Date]) && MIN('Table 2'[Value])<=d,1,0)
RETURN
e
i am taking data of machine and date
consider table2[value] as your downtime date column
if after selected date you have less then 20 downtime field it also show that
see below image
use measure in visual level filter
you can download file from below
You can achieve this by following these steps:
Sort Downtime Events: First, sort your list of downtime events chronologically based on their timestamps.
Identify Planned Downtime Event: Locate the specific planned downtime event that you've selected in the sorted list.
Find Next 20 Downtime Events: Once you've located the selected planned downtime event, iterate through the sorted list to find the next 20 downtime events that occurred after the selected event.
Hi,
Yes I can easily do this but it's a long winded way as there are so many downtime events. I want to be able to Pareto chart the next 20 downtime events after a selected stoppage and going through a massive list of downtime events doesn't work great.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |