Forum Discussion
We cannot convert the value null to type Logical error
- 1 year ago
Hi EaglesTony
The error doesn't come from your code syntax, but rather from the data itself. The message
"We cannot convert the value null to type Logical"
usually indicates that Power Query is trying to evaluate a logical condition on a null value – possibly during internal comparison or grouping logic.In your case, it's likely that one of the grouping columns contains null values:
FeatureKey
Histories-NonFeatures.AddedorRemovedFromParent
If either of those has nulls, the grouping may fail because Power Query can't group or compare null values as expected.
To investigate this, you can do one of the following:
Enable Column Profiling in Power Query:
Go to the View tab and turn on "Column profile" and "Column quality". This will help you see if there are any nulls in those columns.Add a filtering step before the grouping to remove nulls:
Table.SelectRows(#"Filtered Rows1", each [FeatureKey] <> null and [Histories-NonFeatures.AddedorRemovedFromParent] <> null)
Then apply your Table.Group step as planned.If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi EaglesTony
The error doesn't come from your code syntax, but rather from the data itself. The message
"We cannot convert the value null to type Logical"
usually indicates that Power Query is trying to evaluate a logical condition on a null value – possibly during internal comparison or grouping logic.
In your case, it's likely that one of the grouping columns contains null values:
FeatureKey
Histories-NonFeatures.AddedorRemovedFromParent
If either of those has nulls, the grouping may fail because Power Query can't group or compare null values as expected.
To investigate this, you can do one of the following:
Enable Column Profiling in Power Query:
Go to the View tab and turn on "Column profile" and "Column quality". This will help you see if there are any nulls in those columns.
Add a filtering step before the grouping to remove nulls:
Table.SelectRows(#"Filtered Rows1", each [FeatureKey] <> null and [Histories-NonFeatures.AddedorRemovedFromParent] <> null)
Then apply your Table.Group step as planned.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
I'll give this a shot and let you know.
It sometimes times out getting the data from Odata source, I'm wondering if doing this in DAX would be better.