Forum Discussion

Leighla00's avatar
Leighla00
Frequent Visitor
1 year ago
Solved

Cannot Create Percentage off of True/False Data

I'm trying to create a calculation that will output a percentage based off of true/false data.

 

 

 

Completion Rate =

CALCULATE(COUNT('2024'[Status]),'2024'[In Arbitration?]=TRUE())

 

"Dax comparison operations do not support comparing values of type text with values of type true/false. Consider using the value or format function to convert one of the values."

 

I am getting the above error, but I have checked both the data type and format for the column, and they both say "True/False". None of them say "Text". I don't know what to do.

  • Hi Leighla00 ,

     

    You're trying to use the function version of TRUE(), rather than a scalar value.

    Try changing to this:

    CALCULATE(
        COUNT('2024'[Status]),
        '2024'[In Arbitration?] = 1
    )

     

    Boolean values True/False are just the integers 1/0 in the background.

     

    Pete

4 Replies

  • Hi Leighla00 ,

     

    You're trying to use the function version of TRUE(), rather than a scalar value.

    Try changing to this:

    CALCULATE(
        COUNT('2024'[Status]),
        '2024'[In Arbitration?] = 1
    )

     

    Boolean values True/False are just the integers 1/0 in the background.

     

    Pete

    • Leighla00's avatar
      Leighla00
      Frequent Visitor

      Someone at my organization helped me.

       

      CALCULATE (COUNTROWS (tablename), FILTER (tablename, tablename[Status] = in progress)).

       

      Thanks for trying.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Leighla00 ,

     

    Thank you for reaching out to the Microsoft fabric community forum. regarding the issue your a facing to create a percentage of True/False data.

     

    As BA_Pete already mentioned, please try using the suggested solution. And also it appears that you have found a resolution. If so, kindly mark the helpful reply and accept it as the solution. This will assist other community members in resolving similar issues more efficiently. Feel free to contact us if you have any further questions.

     

    Thank you.