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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
gavinf4444
Frequent Visitor

Determining if event happened in next occurrence

Hello, I have a set of records from various machines which will list any event logs given from an automatic check.  If there are no events to record then this is still saved (shows as blank in the Event column). 

What I want to highlight is if a machine recorded any event (non-blank in Event column) for 2 successive records, eg in my sample data below, I want to show the record for Mac B on 02/01/2023 because it recorded "Non Start" on 01/01/2023 and its subsequent record is "Ignite" on 02/01/2023.

I don't need to highlight Mac C because, although it recorded "Non Start" on 01/01/2023 and "Ignite" on 03/01/2023, it recorded a blank event on 02/01/2023 so effectively its account is reset.

 

Machine IDEventDateHighlight
Mac A 01/01/2023 
Mac BNon Start01/01/2023 
Mac CNon Start01/01/2023 
Mac A 02/01/2023 
Mac BIgnite02/01/2023x
Mac C 02/01/2023 
Mac A 03/01/2023 
Mac B 03/01/2023 
Mac CIgnite03/01/2023 

I've seen a few similar requests here involving a calculated column but nothing exactly the same that I can get to work.

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @gavinf4444 ,

 

Please try:

Highlight = 
var _a = MAXX(FILTER('Table',[Machine ID]=EARLIER('Table'[Machine ID])&&[Event]<>BLANK()&&[Date]<EARLIER('Table'[Date])),[Date])
return IF([Event]<>BLANK()&&[Date]-1=_a,"X")

Final output:

vjianbolimsft_0-1675919965432.png

Best Regards,

Jianbo Li

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
v-jianboli-msft
Community Support
Community Support

Hi @gavinf4444 ,

 

Please try:

Highlight = 
var _a = MAXX(FILTER('Table',[Machine ID]=EARLIER('Table'[Machine ID])&&[Event]<>BLANK()&&[Date]<EARLIER('Table'[Date])),[Date])
return IF([Event]<>BLANK()&&[Date]-1=_a,"X")

Final output:

vjianbolimsft_0-1675919965432.png

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors