Forum Discussion
Anonymous
5 years agoNot applicable
[Expression.Error] We cannot convert the value null to type Logical.
Hi All... I've read through a few similar threads but didn't find a solution to my problem. Hoping someone can assist. I'm using the following code in Power Query to assign a fiscal year (FY...
- Anonymous5 years ago
null values can trip you up when used in if statements, and also with equality operators. I would try:
each if [startdate] = null then "" else if [enddate] = null then "" else if [active] = "1" and [live] = "1" and [latest] = "Green" and [startdate] > #date(2020,3,31) and [enddate] < #date(2021,4,1) then "FY21" else ""
--Nate
Anonymous
5 years agoNot applicable
But if you are actually trying to exclude the rows, you should just select the rows:
Table.SelectRows(PriorStepName, each not is null ([startdate]) and not is null ([enddate]) and [active] = "1" and [live] = "1" and [latest] = "Green" and [startdate] > #date(2020,3,31) and [enddate] < #date(2021,4,1))
--Nate