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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

We cannot convert the value null to type Logical. Details: Value= Type=[Type]

Hi Guys

 

I am getting the above error from the following expression:

 

#"Added Conditional Column2" = Table.AddColumn(#"Added Conditional Column1", "Error Message 4", each if Text.Contains([ErrorMessage], "Status must be equal to 'Open'") then "Job Archived" else ""),

 

Don't know why the error is returned- Column [ErrorMessage] is type text, so there should be no "null's" right?

 

You help will be greatly appreciated.

 

Cheers

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Actually, there is no reason that you cannot have null text values. You can see them like:

Table.SelectRows(PriorStepName, each [ErrorMessage] = null)


But to fix your issue, you could add an if clause before the non null text is evaluated:

 

#"Added Conditional Column2" = Table.AddColumn(#"Added Conditional Column1", "Error Message 4", each if [ErrorMessage] = null then "" else if Text.Contains([ErrorMessage], "Status must be equal to 'Open'") then "Job Archived" else ""),


--Nate

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Actually, there is no reason that you cannot have null text values. You can see them like:

Table.SelectRows(PriorStepName, each [ErrorMessage] = null)


But to fix your issue, you could add an if clause before the non null text is evaluated:

 

#"Added Conditional Column2" = Table.AddColumn(#"Added Conditional Column1", "Error Message 4", each if [ErrorMessage] = null then "" else if Text.Contains([ErrorMessage], "Status must be equal to 'Open'") then "Job Archived" else ""),


--Nate

 

Anonymous
Not applicable

Magic Nate!

 

It works.  I was thinking along those lines, but obviously hashed the expression when I tried to edit it.

 

Thanks heaps

 

D

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.