Forum Discussion

romovaro's avatar
romovaro
Responsive Resident
4 years ago
Solved

COUNTA Dax function

  Hello   I need to create a formula counting for CID....How many contains Task "Partner Acknowledgement....." and have a schedule date   Tried with this one.... but  Tasks with GLD & Closed =...
  • Samarth_18's avatar
    4 years ago

    Hi romovaro ,

    You can try below code:-

    Tasks with GLD & Closed =
    CALCULATE (
        COUNTA ( CELERGO_12062021V1[SCHEDULED] ),
        CONTAINSSTRING ( CELERGO_12062021V1[TASK], "Partner Acknowledgement" )
            && CELERGO_12062021V1[TASK_STATUS] = "Closed"
    )

     

    Thanks,

    Samarth

  • Samarth_18's avatar
    Samarth_18
    4 years ago

    romovaro , Just small correction it should be like this:-

    Total Tasks =
    CALCULATE (
        COUNTA ( CELERGO_12062021V1[TASK] ),
        CONTAINSSTRING ( CELERGO_12062021V1[TASK], "Partner Acknowledgement" )
    )

     

  • Samarth_18's avatar
    Samarth_18
    4 years ago

    If you want to include in same code then you can use this code:-

     

    Tasks Pre Engagement Received =
    VAR result =
        CALCULATE (
            COUNT ( CELERGO_12062021V1[CLIENT_NAME] ),
            FILTER (
                CELERGO_12062021V1,
                CELERGO_12062021V1[TASK]
                    IN { "Pre Engagement Process", "IPM HandOff" }
                    && CELERGO_12062021V1[TASK_STATUS] IN { "Closed", "Open" }
            )
        )
    RETURN
        IF ( ISBLANK ( result ), 0, result )

     

    and if you need seperate one then below would be the code:-

     

    Tasks Pre Engagement Received =
    VAR result =
        CALCULATE (
            COUNT ( CELERGO_12062021V1[CLIENT_NAME] ),
            FILTER (
                CELERGO_12062021V1,
                CELERGO_12062021V1[TASK] = "IPM HandOff"
                    && CELERGO_12062021V1[TASK_STATUS] = "Open"
            )
        )
    RETURN
        IF ( ISBLANK ( result ), 0, result )

     

     

    romovaro  You can ask as many question you want. ğŸ™‚