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
matteocarnelos
Advocate III
Advocate III

Add Date: column with start and column with days to add

Hi guys,

in my report I want to add, for each row, some days to "today".

 

The days to add and the date today are in two calculated column named, respectively, "Copertura Giorni" and "Oggi", and both are in the same table "Tabella".

  

1.JPG

 

I've used this formula

 

Data Stock Out = DATEADD(Tabella[Oggi].[Date];'Tabella'[Copertura Giorni];DAY)

 

to add the days in "Copertura Giorni" to today.

 

The problem is that the formula works only when the results is within the year.

 

problema.JPG

 

Do you know where is the error or a way to solve?

 

Thank you.

1 ACCEPTED SOLUTION

Column = [Oggi] + [Copertura Giorni] * 1.

Make sure Column is formatted as a Date or Date/Time.

 

Date columns are really just numbers. They are the number of days since December 30th, 1899. The whole number portion is the number of days and the decimal portion is the time component.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

8 REPLIES 8
Greg_Deckler
Community Champion
Community Champion

If you want the number of days from some date to another date you can just subtract the two and make sure that the column is formatted to whole number.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

thank you for reply.

 

I want the "Data Stock Out "date, for example:

 

input:

"Oggi" = 06/08/2018

"Copertura Giorni" = 10

 

output (with the formula):

"Data Stock Out" = 16/08/2018

Have you tried DATEADD it seems ideal to the case you have described. If it is not working somehow please share the pbix file there might be other issues due to which it might not be functioning as intended

I did confirm that DATEADD when using DAYS and adding a number of days that goes past the end of the year that the function returns blank. Seems like a bug to me.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I think it too.

Do you think that someone should report the bug?

You could check the Issues forum here:

https://community.powerbi.com/t5/Issues/idb-p/Issues

And if it is not there, then you could post it.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Following @Greg_Deckler advixe i have posted the issue. Please read the blog to get better undestanding of the actual problem here which is also highlighted in the question.

Column = [Oggi] + [Copertura Giorni] * 1.

Make sure Column is formatted as a Date or Date/Time.

 

Date columns are really just numbers. They are the number of days since December 30th, 1899. The whole number portion is the number of days and the decimal portion is the time component.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.