Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to count column with filter

I want to count column Status2020 not equal B and Status2021 = B 

 

I use the formula as below.

    COUNT(('Before 2021'[Status(2020)]),

    FILTER('Before 2021','Before 2021'[Status(2020)]<>"B") && 'Before 2021','Before 2021'[Status(2021)]="B"))
 
But formula error.
 
Please guide me about it.
  • what are you trying to do?  ive reformatted it below but not sure what your objective is.

     

    measure =
    CALCULATE (
        COUNT ( 'Before 2021'[Status(2020)] ),
        FILTER (
            'Before 2021',
            'Before 2021'[Status(2020)] <> "B"
                && 'Before 2021'[Status(2021)] = "B"
        )
    )

  • HI Anonymous 

    What's the error?

    Please provide sample data.

    regards

    Phil

2 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    what are you trying to do?  ive reformatted it below but not sure what your objective is.

     

    measure =
    CALCULATE (
        COUNT ( 'Before 2021'[Status(2020)] ),
        FILTER (
            'Before 2021',
            'Before 2021'[Status(2020)] <> "B"
                && 'Before 2021'[Status(2021)] = "B"
        )
    )

  • HI Anonymous 

    What's the error?

    Please provide sample data.

    regards

    Phil