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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Phil_PBI_User19
New Member

How do I add days (from an existing column) to a date column to make a new date

I have a table with courses and dates completed. Each course has a different time period for renewal. 

I want to take that date last completed and add days to the date for that row to calculate next due date.

ie. 

Course       Date               Days till due                            New due date

1                01/01/2020    182 days                                  ?

2                02/02/2020     365 days                                 ?

3                03/03/2020     730 days                                 ?

 

Fairly new to PBI. Can anyone help with the DAX for this?

Thanks

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi  , 

You can try this:-

 

New Due Date =
VAR _daysPosition =
    FIND ( "days", 'Table (2)'[Days till due  ], 1 )
RETURN
    'Table (2)'[date]
        + INT ( TRIM ( REPLACE ( 'Table (2)'[Days till due  ], _daysPosition, 4, "" ) ) )

 

 

Output:-

 

 

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

5 REPLIES 5
Phil_PBI_User19
New Member

I just get the following error message:

 

A single value for column 'Date' in table 'Courses' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregate such as min, max, count or sum to get a single result. 

Anonymous
Not applicable

Hi @Phil_PBI_User19 ,

If what you want is a measure, just modify Samarth's code slightly.

New Due Date2 = 
VAR _daysPosition =
    FIND ( "days", MAX('Table'[Days till due]), 1 )
RETURN
    MAX('Table'[date])
        + INT ( TRIM ( REPLACE ( MAX('Table'[Days till due]), 5, 4, "" ) ) )

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

@Phil_PBI_User19 Since you are trying to create a measure thats why you are getting this error. Try to create a column instead.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Samarth_18
Community Champion
Community Champion

Hi  , 

You can try this:-

 

New Due Date =
VAR _daysPosition =
    FIND ( "days", 'Table (2)'[Days till due  ], 1 )
RETURN
    'Table (2)'[date]
        + INT ( TRIM ( REPLACE ( 'Table (2)'[Days till due  ], _daysPosition, 4, "" ) ) )

 

 

Output:-

 

 

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

lukiz84
Memorable Member
Memorable Member

New due date := [Date] + [Days till due]

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors