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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
laikittmun
Frequent Visitor

Date column which contains null value in Azure SQL MI encountered error

All the date columns in the dataset encountered following error when displaying in Power BI Service/Desktop. Only date columns which contain null value in it and the database is Azure SQL MI. 

Error Message:
The conversion of a date data type to a datetime data type resulted in an out-of-range value.. The exception was raised by the IDataReader interface. Please review the error message and provider documentation for further information and corrective action.

 

The connection of power BI to the Azure SQL MI database is Direct Query. Hence I cant set the date column with Replace Error option in POwer Query Editor. I have tried to use following workaround to set the date to blank() or a dummy date when it is null but the same error still returning. 

IF(ISBLANK('DIM-Agent'[A_APPT_DATE])=True,BLANK(),'DIM-Agent'[A_APPT_DATE])

IF(ISBLANK('DIM-Agent'[A_APPT_DATE])=True,DATE(2999,12,31),'DIM-Agent'[A_APPT_DATE])

 

Could anyone assist  ?

 

1 REPLY 1
freginier
Solution Specialist
Solution Specialist

3 options :

- import your data and transform data

- or use DirectQuery SQL statement from Power BI to transform data (replace / cast / etc),

- or create a view with your SQL transformations

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.