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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rocky84
Regular Visitor

Adding variable number of days to a date column

Hello

 

Hoping for some help here on Power BI.

 

I have a master data table with data from multiple different periods combined (i.e. data for May month end, June month end, July month end etc.). My data tells me for each transaction the number of outstanding days on the trade until maturity, but it doesnt tell me the exact maturity date, hence I'm trying unsuccessfully to work this out. I can do it in excel and load it that way, but would rather do it in Power BI itself.

 

i.e. Period = 31/07/2022 (in date format & given in the data)

Outstanding Maturity = 89 (in numerical format & given in the data)

 

Maturity date = 28/10/2022 (required date format & NOT given in the data, but would like to derive from 31/07/2022 + 89 days)

 

Can anyone help me out? After this I would then like to group all my data by the new maturity date by months + year

 

any help much appreciated 🙂

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@rocky84 , if want to add days to date then you can simply add both, but date should have date data type 

 

[period] + [outstanding date]

 

 

for rest use date as dateadd

Date as Dateadd - Decoding Date and Calendar 5-5 - Power BI Turning 5 Celebration Series
https://community.powerbi.com/t5/Community-Blog/Date-as-Dateadd-Decoding-Date-and-Calendar-5-5-Power...

View solution in original post

vanessafvg
Super User
Super User

 DATEADD ( 'Date'[Date], -1, MONTH )

 

maturity date =
VAR noofdays = 89
VAR result =
    DATEADD ( 'Calendar'[Date], noofdays, DAY )
RETURN
    result

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
vanessafvg
Super User
Super User

 DATEADD ( 'Date'[Date], -1, MONTH )

 

maturity date =
VAR noofdays = 89
VAR result =
    DATEADD ( 'Calendar'[Date], noofdays, DAY )
RETURN
    result

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




amitchandak
Super User
Super User

@rocky84 , if want to add days to date then you can simply add both, but date should have date data type 

 

[period] + [outstanding date]

 

 

for rest use date as dateadd

Date as Dateadd - Decoding Date and Calendar 5-5 - Power BI Turning 5 Celebration Series
https://community.powerbi.com/t5/Community-Blog/Date-as-Dateadd-Decoding-Date-and-Calendar-5-5-Power...

Thankyou sir. Always so helpful 😁

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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