Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Error Cannot convert value of type Text to type True/False.

Hi!

 

I'm try to use "countifs" excel funciont in PowerBi.

 

I used this: 

Concluído? = Calculate(
COUNTROWS(BASE_PEDIDO),
BASE_PEDIDO[STATUS] = "CONCLUIDO", BASE_PEDIDO[ID_ATENDIMENTO])

But the Power Bi return this erro "Cannot convert value 'XXXXX' of type Text to type True/False."

Can anyone help me?

  • Hi, Anonymous 

     

    It’s my pleasure to answer for you.

    According to your description, I think you can check the type of the column ‘BASE_PEDIDO[ID_ATENDIMENTO]’.

    Like this:

    If the column isn’t logical type , it can’t be used directly in calculate expression. You can try BASE_PEDIDO[ID_ATENDIMENTO] = "XXXX".

     

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi!

       

      Sorry, this is the name of my column.

       

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        If that is a column, then you must give a criteria such as BASE_PEDIDO[ID_ATENDIMENTO]="XYZ"

    • amitchandak's avatar
      amitchandak
      Icon for Super User rankSuper User

      Anonymous , Either you should check the value for BASE_PEDIDO[ID_ATENDIMENTO]  or remove it

       

      Concluído? = Calculate(
      COUNTROWS(BASE_PEDIDO),
      BASE_PEDIDO[STATUS] = "CONCLUIDO", BASE_PEDIDO[ID_ATENDIMENTO] = "??")

       

      or

       

      Concluído? = Calculate(
      COUNTROWS(BASE_PEDIDO),
      BASE_PEDIDO[STATUS] = "CONCLUIDO")

  • v-janeyg-msft's avatar
    v-janeyg-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    It’s my pleasure to answer for you.

    According to your description, I think you can check the type of the column ‘BASE_PEDIDO[ID_ATENDIMENTO]’.

    Like this:

    If the column isn’t logical type , it can’t be used directly in calculate expression. You can try BASE_PEDIDO[ID_ATENDIMENTO] = "XXXX".

     

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.