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
elukianic
Frequent Visitor

Calculating max date for a group of a previous task

Hello All,

 

I am trying to have a calculated column where I am getting a max end date for the previous taskno. (task numbers are not sequencial, its just previous task is always smaller than a current task). This calculation will be done per group orderid, resseq resinstanceid and task no.

 

So in this example below. For taskno 3 it should be null in calculated column, for taskno 4 it should be 11/9/2021 since the previous task is number 3 and the max end date for that group is 11/9/2021. For task no 6 it should be 11/23/2021, because previous task number is 4 and the max end date in that group is 11/23/2021. Thank you all for help!

 

Capture.JPG

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@elukianic 

pls try this

Column = 
VAR _task= maxx(FILTER('Table (2)','Table (2)'[orderid]=EARLIER('Table (2)'[orderid])&&'Table (2)'[taskno]<EARLIER('Table (2)'[taskno])),'Table (2)'[taskno])
return maxx(FILTER('Table (2)','Table (2)'[orderid]=EARLIER('Table (2)'[orderid])&&'Table (2)'[taskno]=_task),'Table (2)'[endtime])

1.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
elukianic
Frequent Visitor

Worked like a charm! Thank you!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@elukianic 

pls try this

Column = 
VAR _task= maxx(FILTER('Table (2)','Table (2)'[orderid]=EARLIER('Table (2)'[orderid])&&'Table (2)'[taskno]<EARLIER('Table (2)'[taskno])),'Table (2)'[taskno])
return maxx(FILTER('Table (2)','Table (2)'[orderid]=EARLIER('Table (2)'[orderid])&&'Table (2)'[taskno]=_task),'Table (2)'[endtime])

1.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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