Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello, I know this issue has been raised so many times on this formu, I tried to work on that and use your solutions to my code, but with no success. During the refreshing I face this bug:
OLE DB or ODBC error: [Expression.Error] We cannot convert the value null to type Logical.. An unexpected exception occurred.
I assume, the problem is here:
I have the column with a date (data type: Date/Time) and with some rows this date is empty, which is fine, I cannot remove these ones. But how can I replace these values? I think that adding the new column does not solve my problem, because during the refreshing the issue will occur anyway. How to fix it?
Solved! Go to Solution.
Hi @Anonymous ,
Approve with @amitchandak , when there is null value in a data column, it won’t get error.
It seems that you used the null value in somewhere else?
Please try to replace these null values with 9999/12/31
Here is the M code:
let
Source = Excel.Workbook(File.Contents("C:\xxx\New Microsoft Excel Worksheet.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type date}, {"Column2", type number}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",null,#date(9999, 12, 31),Replacer.ReplaceValue,{"Column1"})
in
#"Replaced Value"
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Approve with @amitchandak , when there is null value in a data column, it won’t get error.
It seems that you used the null value in somewhere else?
Please try to replace these null values with 9999/12/31
Here is the M code:
let
Source = Excel.Workbook(File.Contents("C:\xxx\New Microsoft Excel Worksheet.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type date}, {"Column2", type number}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",null,#date(9999, 12, 31),Replacer.ReplaceValue,{"Column1"})
in
#"Replaced Value"
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is works for this column, thank you
Maybe the problem is elsewhere, I don't know how to find exactly where the problem is. Could you please advise me?
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
37 | |
31 | |
26 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |