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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to calculate new date base on duration day from start date

I wotld like to calculate new date base on duration day(duration come form another caluateion) from start date. and stiwh on somedate which are not in the list of table 2

table 1

Teamstart dateDuration dayNew date
A22-Feb-21224-Feb-21( swith 23-Feb)
A22-Feb-21122-Feb-21
B22-Feb-21324-Feb-21

 

Table 2

Teamwork day
A22-Feb-21
A24-Feb-21
A25-Feb-21
B22-Feb-21
B23-Feb-21
B24-Feb-21

How  calulate "New date" column in table 1 by swicth the date if it is not in the list of each team from table2 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Column = 
VAR t =
    FILTER ( 'Table 2', 'Table 2'[Team] = EARLIER ( 'Table 1'[Team] ) )
VAR NewDate = [start date] + [Duration day] - 1
VAR ModifiedNewDate =
    MINX ( FILTER ( t, [work day] >= NewDate ), [work day] )
RETURN
    ModifiedNewDate

create a column.JPG

 

Measure = 
VAR NewDate =
    MAX ( [start date] ) + MAX ( [Duration day] ) - 1
VAR ModifiedNewDate =
    MINX ( FILTER ( 'Table 2', [work day] >= NewDate ), [work day] )
RETURN
    ModifiedNewDate

create a MEASUR.JPG

 

 

Best Regards,

Icey

 

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

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Column = 
VAR t =
    FILTER ( 'Table 2', 'Table 2'[Team] = EARLIER ( 'Table 1'[Team] ) )
VAR NewDate = [start date] + [Duration day] - 1
VAR ModifiedNewDate =
    MINX ( FILTER ( t, [work day] >= NewDate ), [work day] )
RETURN
    ModifiedNewDate

create a column.JPG

 

Measure = 
VAR NewDate =
    MAX ( [start date] ) + MAX ( [Duration day] ) - 1
VAR ModifiedNewDate =
    MINX ( FILTER ( 'Table 2', [work day] >= NewDate ), [work day] )
RETURN
    ModifiedNewDate

create a MEASUR.JPG

 

 

Best Regards,

Icey

 

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

 

Anonymous
Not applicable

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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