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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Chris123Terr
Frequent Visitor

The DATEADD function returns wrong values.

Hello. I have a calendar table made with dax:

calendar= Calendar(min(Date), max(Date))

The calendar starts on 07/04/1996 and ends on 06/11/1998

Now. I am using the function:

ALL = Calculate(sum(column), dateadd(calendar[Date], -1, Year)

 

And it returns wrong values, but when I alter the calendar table so that it starts on 01/01/1996 and ends on 12/31/1998, it returns the correct values. Why does this happen?

3 REPLIES 3
HotChilli
Community Champion
Community Champion

Well, DATEADD is a function that returns a date (or strictly a set of dates) but those dates must already exist in the date table defined in the model, for example, if you have a date table which has dates 15/03/1992 to 20/03/1992 i.e. just 6 dates and you use a formula like DATEADD(Calendar[Dates], 4, DAY) then the results would be like this:

15/03/1992 ->19/03/1992

16/03/1992 ->20/03/1992

17/03/1992 -> Should be 21/03/1992 but will return blank as 21/03/1992 is not in the original dates table

18/03/1992 -> Should be 22/03/1992 but will return blank as 22/03/1992 is not in the original dates table

and so on

HotChilli
Community Champion
Community Champion

What are the wrong values?

The key point that catches a lot of people is that DATEADD can only return dates which already exist in the date table.

As the date table you have is quite limited, I suspect this is what's happening

What do you mean by? "DATEADD can only return dates which already exist in the date table."
Thanks

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.