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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
SteveCarter1
Advocate II
Advocate II

Export table with date in year 1900 in Excel format, it adds 1 day to the date all by itself?!

I'm in Australia so using dd/mm/yyyy format. Fabric DC is Australia East Coast.  Web browser correctly (for me) shows date.

This seems to only affect dates with a year of 1900.

 

I can easily reproduce this with a blank PBI report, enter data, manually type in some dates dates starting of 01/01/1900 then add that field to a table visual.

This doesn't seem to matter, but for this particular test I also changed the default date format to '*14/03/2001 (Short Date)'


I created this test case using PBI Desktop because I'm having issue with other reports that have to use Desktop.

I was also able to reproduce this by creating this same data and report from inside the PBI service itself.

I Enter data, and add these dates:

SteveCarter1_21-1694079733473.png

 

In Power BI Service my table visual looks like this:

SteveCarter1_13-1694079003900.png

 

I then export that table with the default 'Data with current layout' option:

SteveCarter1_14-1694079030932.png

Then open in Excel.

SteveCarter1_15-1694079129607.png

I understsand years prior to 1900 are not handled so the # isn't a big deal, but why is 1 day added to all of my 1900 dates only? The 1901 dates are left alone?

 

So next test I exported again but this time used Summarized data with Excel live connection:

SteveCarter1_16-1694079311032.png

 

Again the 1899 date is no surprise, but at least now the 1900 dates match what is in my report.

SteveCarter1_17-1694079358783.png

 

Next test is exporting using Summarized data but changing format to Excel format:

SteveCarter1_18-1694079397866.png

Same wrong result as when using 'Data with current layout' option. What is Excel doing differently between the live connection and this offline version?

 

Lastly I tested the summarized data with CSV format:

SteveCarter1_19-1694079484608.png

 

Well I wasn't expecting the different format for the 1899 date, but at least the 1900 dates haven't been fiddled with:

SteveCarter1_20-1694079546645.png

 

Can anyone help with this mystery? It has me stumped...

4 REPLIES 4
ibarrau
Super User
Super User

Hi. I think all this it's because DAX supports dates starting in 1900. As the amazing SQLBI Guys explain "DAX stores a date as a decimal number, where the integer part is the number of days elapsed since December 31, 1899 and the decimal part is the fraction of the day

DAX represents with 1 the day of December 31, 1899. Why this? Because the original implementation of Lotus 1-2-3 had a bug and considered 1900 as a leap year that included February 29, 1900. Because 1900 is not a leap year, the dates before March 2, 1900 where misrepresented in Lotus 1-2-3."

You can read more about that here: https://www.sqlbi.com/blog/marco/2018/08/16/dates-differences-between-excel-and-dax/

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Thanks for that, but it does not explain why the Extract data options of Excel with live connection versus Excel produce different results. Based on above logic I would expect a consistent result in Excel, and even saying that, from what you've found it confirms they do support dates from 1st Jan 1900 so why is Excel changing the date all by itself?

Hi @SteveCarter1,

Did you actually find a solution for this?

No I did not, but based on the very interesting history given by ibarrau, it would seem it maybe has something to do with an ancient quirk related to Lotus 1-2-3.

It might be that dates from 1st March 1900 are okay based on that same explanation.

Why the export works in some formats correctly and not others, I do not know.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

Top Solution Authors