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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
JFAschoon
Helper I
Helper I

How to create a colomn to see what is between 2 specific events

Good day Friends.

Is it possible to  view/create a colomn to see what multiple events fall between 2 specific events in a colomn.

i have thousand of rows in a data sheet and need to view the events located between PumpON and PupmOFF and i dont want to see the events between PumpOFF and PumpON. see below the example of data that i have and the expected result.

Or is it possible to create a filter to show only whats between 2 specific texts.

 

Example:

08/29/202313:35:02d2dam PumpOFF
08/29/202313:35:03d2daZone_HAZARD  Switch____
08/29/202313:35:03d2daZone_Warn2   Switch____
08/29/202313:35:03d2daZone_ID      Switch____
08/29/202313:35:04d2dam HazardCleared Warning
08/29/202313:35:09d2dam PumpON
08/29/202313:35:09d2dam Hazard WarningCleared
08/29/202313:35:10d2dam PumpOFF
08/29/202313:35:10d2daZone_HAZARD  Switch____
08/29/202313:35:17d2daGone
08/29/202313:35:19d2daZone_Monitor Switch____
08/29/202313:35:23d2daZone_Warn2   Switch____
08/29/202313:35:25d2dam HazardCleared Warning
08/29/202313:35:27d2daZone_ID      Switch____
08/29/202313:35:27d2dam PumpON
08/29/202313:35:33d2daZone_Monitor Switch____
08/29/202313:35:37d2daZone_ID      Switch____
08/29/202313:35:38d2dam PumpOFF
08/29/202313:35:38d2daZone_Monitor Switch____
08/29/202313:35:39d2daZone_Monitor Switch____
08/29/202313:35:42d2dam PumpON
08/29/202313:36:51d2daZone_Warn1   Switch____
08/29/202313:36:51d2daZone_Monitor Switch____
08/29/202313:36:51d2daZone_ID      Switch____
08/29/202313:40:36d2daZone_HAZARD  Switch____
08/29/202313:40:36d2dam PumpOFF

 

Expected result:

08/29/202313:35:02d2dam PumpOFF
08/29/202313:35:09d2dam PumpON
08/29/202313:35:09d2dam Hazard WarningCleared
08/29/202313:35:10d2dam PumpOFF
08/29/202313:35:27d2dam PumpON
08/29/202313:35:33d2daZone_Monitor Switch____
08/29/202313:35:37d2daZone_ID      Switch____
08/29/202313:35:38d2dam PumpOFF
08/29/202313:35:42d2dam PumpON
08/29/202313:36:51d2daZone_Warn1   Switch____
08/29/202313:36:51d2daZone_Monitor Switch____
08/29/202313:36:51d2daZone_ID      Switch____
08/29/202313:40:36d2daZone_HAZARD  Switch____
08/29/202313:40:36d2dam PumpOFF
08/29/202313:40:50d2dam PumpON
08/29/202313:40:56d2daZone_HAZARD  Switch____
08/29/202313:40:56d2dam Hazard WarningCleared
08/29/202313:40:56d2dam PumpOFF

 

Thanks in advance for any assistance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JFAschoon ,

 

I suggest you to add an index column in Power Query Editor to help calculation.

Measure:

 

Measure = 
VAR _LASTON = CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[Column3] = "m PumpON" && 'Table'[Index] <=MAX('Table'[Index])))
VAR _LASTOFF = CALCULATE(max('Table'[Index]),FILTER(ALL('Table'),'Table'[Column3] = "m PumpOFF" && 'Table'[Index] <MAX('Table'[Index])))
RETURN
IF(MAX('Table'[Column3]) in {"m PumpOn","m PumpOFF"} || _LASTON>_LASTOFF,1,0)

 

Add this measure into the visual level filter and set it to show items when value = 1.

vrzhoumsft_1-1698919078547.png

 

 

Best Regards,
Rico Zhou

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @JFAschoon ,

 

I suggest you to add an index column in Power Query Editor to help calculation.

Measure:

 

Measure = 
VAR _LASTON = CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[Column3] = "m PumpON" && 'Table'[Index] <=MAX('Table'[Index])))
VAR _LASTOFF = CALCULATE(max('Table'[Index]),FILTER(ALL('Table'),'Table'[Column3] = "m PumpOFF" && 'Table'[Index] <MAX('Table'[Index])))
RETURN
IF(MAX('Table'[Column3]) in {"m PumpOn","m PumpOFF"} || _LASTON>_LASTOFF,1,0)

 

Add this measure into the visual level filter and set it to show items when value = 1.

vrzhoumsft_1-1698919078547.png

 

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors