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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tuncay
Helper III
Helper III

Power Query: We cannot convert the value null to type Logical

I have a column with different numbers. However there also rows with null...


When I try to create a new column (LTAR1) and try to put 0 every time a "null" is detected, it gives me the following error:

 

Expression.Error: We cannot convert the value null to type Logicalerrormessage.PNG

 

See the part: else if [LTAR] = null then 0...

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Typically you would replace the null values with 0 (zero) before adding the custom column OR

create a variable like :

let col1 = if [Column1] = null then 0 else [Column1] in ......        and use the variable col1 in the 'if..then..else' you have above.  That can look a bit messy but it should work

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

Typically you would replace the null values with 0 (zero) before adding the custom column OR

create a variable like :

let col1 = if [Column1] = null then 0 else [Column1] in ......        and use the variable col1 in the 'if..then..else' you have above.  That can look a bit messy but it should work

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors