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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Row filtering

Hi,

 

Data

I have a dataset in which different units (unit_id's) get an update every 10 minutes. There are multiple columns under which a datetime column, a idle_time column and unit_id column. 

 

Necessary

I need just the rows in which the next value of idle_time is 0 (per unit).

So for example from unit 1&2:

 

update_idunit_id datetimeidle_time
111-5-2021 10:10    53
211-5-2021 10:20    63
321-5-2021 10:23    12
411-5-2021 10:30     0
521-5-2021 10:33    22
621-5-2021 10:43     0

 

I now just need the bold rows (the peeks per unit). All updates and al units are in the same table. How can i filter the rows out for every unit, where the next idle_time value is 0? So it's based on the date-time increasing (which is easy to ascend or descend).

 

A unit has multiple updates a day, and also multiple peaks. That's what makes it difficult. 

 

Thanks!

1 ACCEPTED SOLUTION
HotChilli
Community Champion
Community Champion

I haven't tested this at all so see how you get on (with multiple 0 values for same id etc).

It's a column

NextOneIsZero = VAR _unit = TableM[unit_id]
VAR _update = TableM[update_id]
VAR _0ID = CALCULATE(MIN(TableM[update_id]), FILTER(TableM, TableM[unit_id] = _unit && TableM[idle_time] = 0 && TableM[update_id] > _update))
VAR _prev0ID = CALCULATE(MAX(TableM[update_id]), FILTER(TableM, TableM[unit_id] = _unit && TableM[update_id] < _0ID))
RETURN
IF (_prev0ID = _update, 1,0)

 

View solution in original post

1 REPLY 1
HotChilli
Community Champion
Community Champion

I haven't tested this at all so see how you get on (with multiple 0 values for same id etc).

It's a column

NextOneIsZero = VAR _unit = TableM[unit_id]
VAR _update = TableM[update_id]
VAR _0ID = CALCULATE(MIN(TableM[update_id]), FILTER(TableM, TableM[unit_id] = _unit && TableM[idle_time] = 0 && TableM[update_id] > _update))
VAR _prev0ID = CALCULATE(MAX(TableM[update_id]), FILTER(TableM, TableM[unit_id] = _unit && TableM[update_id] < _0ID))
RETURN
IF (_prev0ID = _update, 1,0)

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.