Forum Discussion
Dicken
Post Prodigy
24 days agofunction logical error
Hi, i kinda get why this error happens but thougt someone might have thoughts insights into the error problem; i i start with a true false ; = let test =( x)=> Number.Round(x) = x i...
- 24 days ago
Hi Dicken,
In Power query, functions themselves can't be used as a boolean value. Test is a function, not a boolean itself, so you need to call the function with a value for it to return something useful.
let
test = (x) => Number.Round(x) = x,
result = if test(5) then "whole" else "decimal"
in
result
Dicken
Post Prodigy
23 days agoyes, i did see why it failed after posting ,i was actually trying for a function that tests a a value
and continues various tests until a true is reached, this is a work in progress, but my first obstacle
, this one is now fixed.