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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Naomig2088
Helper II
Helper II

Cannot convert the value null to type Logical

I have a conditional column:

if [startdate] >= [validtodate] then 1 else 0

which produces a result. However when I filter on the result column (only to include 1) and then group the result, I'm presented with the above error.

Can anyone please offer a solution?

Many thanks.

1 ACCEPTED SOLUTION
HotChilli
Community Champion
Community Champion

Ok, so this is all in Power Query preview screen?

What is the Grouping M code? 

Do you have null values in your data?

 

View solution in original post

4 REPLIES 4
HotChilli
Community Champion
Community Champion

Ok, so this is all in Power Query preview screen?

What is the Grouping M code? 

Do you have null values in your data?

 

I've just realised I had null value in one column. There was so much data that it hadn't all loaded so I didn't see it intially, but once I've selected 'load more' it's become visible.

Thank you for your help!

HotChilli
Community Champion
Community Champion

"when I filter on the result column" - you have created a visual with the column in it? What visual and what else is in it?

"then group the result" - what does this mean? how are you grouping it?

 

Sorry, no, when I say filter, I mean, once I have the result of the conditional column above then I've filtered that column to only show the '1'.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.