Forum Discussion

kimstriebel's avatar
kimstriebel
Regular Visitor
3 years ago
Solved

Count if true in two columns

I am trying to figure out how to create a column that will count if two other columns have a value of true. For example: 

 

AC
True True 1
True FALSE0
FALSETrue 0
True True  
FALSETrue  
FALSEFALSE 
FALSETrue  
True True  

 

I am trying to populate column C to count, either in true/false or a number, when both columns say true. 

Any ideas? 

  • Hey kimstriebel,

    If column 'A' and 'B' have the data type 'boolean', you can use this formula:

    C = 
    INT ( AND ( 'Table'[A], 'Table'[B] ) )

    If they have data type 'text' then this:

    C =
    INT (
        AND (
            CONTAINSSTRING ( 'Table'[A], "true" ),
            CONTAINSSTRING ( 'Table'[B ], "true" )
        )
    )

1 Reply

  • Barthel's avatar
    Barthel
    Icon for Solution Sage rankSolution Sage

    Hey kimstriebel,

    If column 'A' and 'B' have the data type 'boolean', you can use this formula:

    C = 
    INT ( AND ( 'Table'[A], 'Table'[B] ) )

    If they have data type 'text' then this:

    C =
    INT (
        AND (
            CONTAINSSTRING ( 'Table'[A], "true" ),
            CONTAINSSTRING ( 'Table'[B ], "true" )
        )
    )