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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Mike_Pitcher
New Member

Add a number of days from a column to a date in a new column

Hi 

Sorry but i am new here and just getting started with BI. I need to add the number of Forward Days to Today's date to give me a new column. ie 28/06/2022 + (for branch 1) 11 days = 09-07-2022 (sorry uk date format)

Branch 50 would be 28/06/2022 + 12 days = 10-07-2022 

I have tried DATEADD but that needs a set numeric and TODAY + again needs a single number

Please help.

Mike_Pitcher_0-1656418784088.png

Thanks

 

2 ACCEPTED SOLUTIONS
selimovd
Super User
Super User

Hey @Mike_Pitcher ,

 

the start is always difficult. That's the reason we have here a community that helps.

You can create a new measure that is adding the days to today's date:

Added Days = TODAY () + MAX ( myTable[Forward Days] )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

Hey @Mike_Pitcher ,

 

MAX is giving you the maximum amount of days in this filter context. You need that because in a DAX measure you always need an an aggregation. So for each row it will anyway just return the only number existing.

 

But I'm happy it solved your issue. If you have any question let me know.

 

By the way, in this community always mark people with an "@" and the name of the person . Otherwise I will not get notified that you replied and you will not get an answer 😉

 

Best regards

Denis

View solution in original post

4 REPLIES 4
Mike_Pitcher
New Member

Hi @selimovd 

 

Some more help please, I am having trouble with my table link, when I add the new "Forward Date" you helped me with I get a loop that changes the Forward days which inturn changes the Branch 1 value which returns an incorrect Forward Date. I need Branch 1 to always return 11 days and in the example Forward Days are changing to 10 and so the Branch 1 has changed to 40?

Below the bottom table example is correct and the top table has the Forward Date is added and is now incorrect.

 

I have tried changing the link etc but with no joy.

Thanks in anticipation.

 

Mike_Pitcher_1-1656429748841.png

 

Mike_Pitcher_0-1656429702521.png

 

selimovd
Super User
Super User

Hey @Mike_Pitcher ,

 

the start is always difficult. That's the reason we have here a community that helps.

You can create a new measure that is adding the days to today's date:

Added Days = TODAY () + MAX ( myTable[Forward Days] )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Hi Denis,

Thanks for your solution, it worked brilliantly, MAX I will reserch the use of that 

Hey @Mike_Pitcher ,

 

MAX is giving you the maximum amount of days in this filter context. You need that because in a DAX measure you always need an an aggregation. So for each row it will anyway just return the only number existing.

 

But I'm happy it solved your issue. If you have any question let me know.

 

By the way, in this community always mark people with an "@" and the name of the person . Otherwise I will not get notified that you replied and you will not get an answer 😉

 

Best regards

Denis

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.