Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dax Calc countif

I need help figuring out how to write this formula in dax. 

 

COUNT IF [F RETAIL FH FIRST/FURTHER] = "FIRST" OR "FURTHER"

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Text is not computable for aggregation, I think you need to convert the data type first.

    Through here to change the data type:

    and then you can do some calculation.

    Refer to my pbix file for better understanding.

     

    Best regards,

    Community Support Team Selina zhu

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

9 Replies

  • ERD's avatar
    ERD
    Community Champion

    Anonymous ,

    You can try the measure below:

    your_measure =
    IF (
        'F RETAIL FH FIRST'[FURTHER] IN { "FIRST", "FURTHER" },
        COUNT ( 'F RETAIL FH FIRST'[FURTHER] )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the answer, but that syntax does not work.

      • ERD's avatar
        ERD
        Community Champion

        What's the error?