Forum Discussion

Dicken's avatar
Dicken
Icon for Post Prodigy rankPost Prodigy
22 days ago
Solved

function 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...
  • tayloramy's avatar
    22 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