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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
kfarynowski
Frequent Visitor

invalid date representation

I've created at Holiday table in excel, trying to use to determine work days between two dates.   Looks like everywhere the date column is date format (both in the excel file, and after importing) but I get error in PowerBi desktop of Invalid representation of date in  the statement for the Table1[Date] field.

 

 

 

CalcBusDays = CALCULATE(sum(Table1[IsWorkDay]),DATESBETWEEN(Table1[Date],Query[FileDate],Query[DateEntered]))

1 ACCEPTED SOLUTION

Thanks for the help.  Table1 is a calendar table, but I found that the first date being passed was earlier than the first date in the table.  The message indicating "invalid date representation" seemed like there was a problem with the data format of the column in the calendar table.   I further reviewed the table with the dates being passed and found the unexpected dates.   I expanded the calender table and all worked. 

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

Is table1 a calendar table?  Datesbetween is designed to be used over calendar tables. You need to pass a start date and an end date, but you are passing columns of dates - you can't do that.  Try wrapping the 2 query columns in MIN for the starting column and MAX for the end column. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thanks for the help.  Table1 is a calendar table, but I found that the first date being passed was earlier than the first date in the table.  The message indicating "invalid date representation" seemed like there was a problem with the data format of the column in the calendar table.   I further reviewed the table with the dates being passed and found the unexpected dates.   I expanded the calender table and all worked. 

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.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.