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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Check if value appeared in previous row (week) considering a condition

Hello guys I need help with this DAX function, as per table listed bellow, I need to check when an employee has started working and if it was continuous.

 

Employee ID  Date  New  
111  -25/03/2022  -  0  
111  -18/03/2022  -  0  
333  -18/03/2022  -  1  
444  -18/03/2022  -  1  
111  -11/03/2022  -  0  
222  -11/03/2022  -  1  
111  -04/03/2022  -  1  
333  -04/03/2022  -  1  

 

Conditions:

1. The first time an employee ID shows up New should be 1, else 0.
2. If an employee works one week, stops, and gets to work on a later week New should be 1, else 0 (as per Employee ID: 333)

3. All the dates are friday

 

I had two ideas in mind:

1- Group by each week and VLOOKUP employee ID in the week, which I couldn't

2- Countif (Date-7)&Employee ID=Date&Employee ID

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Assuming this data is immutable here is a calculated column version:

 

lbendlin_0-1648859641302.png

 

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Whether the advice given by @lbendlin  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

lbendlin
Super User
Super User

Assuming this data is immutable here is a calculated column version:

 

lbendlin_0-1648859641302.png

 

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.