Forum Discussion

vjnvinod's avatar
vjnvinod
Impactful Individual
6 years ago
Solved

Calculated coloumn error

hi

 

i am getting below error, can you help?

 

  • Hi vjnvinod ,

     

    Here is the syntax of IF() function:

    IF(logical_test>,<value_if_true>, value_if_false)  

     Now your ture value is a TRUE/FALSE formula, this is why the error occurs. I think you want two conditions, you could use AND(condition1,condition2) or condition1&&condition2 to combine your conditions.

     

4 Replies

  • There are two conditions. For two condition use && (and) || (OR) . The comma is used as of now.

    Also, you need to return the same data type for true and false. If one is number and another on the text.  Then convert number to text like [number] & ""

     

    Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
    Thanks.

    My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

    • vjnvinod's avatar
      vjnvinod
      Impactful Individual

      amitchandak 

       

      didn't follow your logic, can you correct the below measure & help me understand.

       

      Column = IF(DataDumpFull[ReverseVsMercurry]="Not a reverse", DataDumpFull[ActualChrdHours]=ABS(DataDumpFull[ActualChrdHours]),ABS(DataDumpFull[ActualChrdHours]*-1))
      • amitchandak's avatar
        amitchandak
        Super User

        Column = IF(DataDumpFull[ReverseVsMercurry]="Not a reverse" && DataDumpFull[ActualChrdHours]=ABS(DataDumpFull[ActualChrdHours]),ABS(DataDumpFull[ActualChrdHours]*-1,0))

  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi vjnvinod ,

     

    Here is the syntax of IF() function:

    IF(logical_test>,<value_if_true>, value_if_false)  

     Now your ture value is a TRUE/FALSE formula, this is why the error occurs. I think you want two conditions, you could use AND(condition1,condition2) or condition1&&condition2 to combine your conditions.