Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a company roster that I pull every monday as well as the first and last day of every month. If someone's employee ID doesn't show up on the next roster I want to show a termination date of 1 day before the next roster entry.
For example:
Employee ID: Name: Date of Roster: Next Date of EID:
EID 1 Person 1 1/1/2020 1/6/2020
EID 2 Person 2 1/1/2020 1/5/2020
EID 3 Person 3 1/1/2020 1/6/2020
EID 1 Person 1 1/6/2020
EID 3 Person 3 1/6/2020
Thank you for the help
Solved! Go to Solution.
try
Employee next roster date = minx(filter(table,table[Employee ID]=ealier(table[Employee ID) && table[Date of Roster] >earlier(table[Date of Roster])),(table[Date of Roster]))
next roster date = minx(filter(table,table[Date of Roster] >earlier(table[Date of Roster])),(table[Date of Roster]))
terminate = if(isbalnk(table[Employee next roster date]),table[next roster date]-1,blank())
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hi @cmilligan262 ,
Please refer to the Calculated Column below which is merged according to amitchandak's formula.
Column =
var a = CALCULATE(MIN('Table'[Date of Roster]),FILTER('Table','Table'[Date of Roster]>EARLIER('Table'[Date of Roster])))
var b = CALCULATE(MIN('Table'[Date of Roster]),FILTER('Table','Table'[Date of Roster]>EARLIER('Table'[Date of Roster])&&'Table'[Employee ID]=EARLIER('Table'[Employee ID])))
return
IF(ISBLANK(a),BLANK(),IF(ISBLANK(b),a-1,b))Result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
try
Employee next roster date = minx(filter(table,table[Employee ID]=ealier(table[Employee ID) && table[Date of Roster] >earlier(table[Date of Roster])),(table[Date of Roster]))
next roster date = minx(filter(table,table[Date of Roster] >earlier(table[Date of Roster])),(table[Date of Roster]))
terminate = if(isbalnk(table[Employee next roster date]),table[next roster date]-1,blank())
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
What if I'm trying to do it as a calculated column in the table?
Hi @cmilligan262 ,
Please refer to the Calculated Column below which is merged according to amitchandak's formula.
Column =
var a = CALCULATE(MIN('Table'[Date of Roster]),FILTER('Table','Table'[Date of Roster]>EARLIER('Table'[Date of Roster])))
var b = CALCULATE(MIN('Table'[Date of Roster]),FILTER('Table','Table'[Date of Roster]>EARLIER('Table'[Date of Roster])&&'Table'[Employee ID]=EARLIER('Table'[Employee ID])))
return
IF(ISBLANK(a),BLANK(),IF(ISBLANK(b),a-1,b))Result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!