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:    A B  C True  True  1 True  FALSE 0 FALSE True  0 T...
  • Barthel's avatar
    3 years ago

    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" )
        )
    )