Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

HIT calculation for DAX calculation

hii 

i am trying to do the hit of sla by considering 3 conditions. the output i need to get after the operation is EXEMPTED but i am not getting it. Previously i did using COUNTIF function in excel.

can someone help me 

 

HIT = CALCULATE(COUNTX(Query1[Priority]= "PLI_NBD"),FILTER(Query1[SLA Status]="FULFILLED") && (Query1[Exempted SLA]= "N"))
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Try this

    HIT =
    CALCULATE (
        COUNT ( Query1[Priority] ),
        FILTER (
            Query1,
            Query1[SLA Status] = "FULFILLED"
                && Query1[Exempted SLA] = "N"
                && Query1[Priority] = "PLI_NBD"
        )
    )

     

    or

     

    HIT =
    COUNTROWS (
        FILTER (
            Query1,
            Query1[Priority] = "PLI_NBD"
                && Query1[SLA Status] = "FULFILLED"
                && Query1[Exempted SLA] = "N"
        )
    )

     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      hiii greg

       

      i tried using those operations but i count try to get the output.i am getting an error

       The COUNT function only accepts a column reference as an argument. 

      can you plz me to solve this

      HIT = COUNTX(COUNT (Query1 [Priority] = "PLI_NBD" ), FILTER( Query1[SLA Status]="FULFILLED" && Query1 [Exempted SLA]= "N"))
  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Please try this approach

     

    HIT =
    CALCULATE (
    COUNTROWS ( Query1 ),
    Query1[Priority] = "PLI_NBD",
    Query1[SLA Status] = "FULFILLED",
    Query1[Exempted SLA] = "N"
    )

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hii mohit

      i tried using the query u have provided its not showing any error its executed successfully but in the output its showing both exempted and unexempted .

      can you help me with this 

      Thank you

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        Try this

        HIT =
        CALCULATE (
            COUNT ( Query1[Priority] ),
            FILTER (
                Query1,
                Query1[SLA Status] = "FULFILLED"
                    && Query1[Exempted SLA] = "N"
                    && Query1[Priority] = "PLI_NBD"
            )
        )

         

        or

         

        HIT =
        COUNTROWS (
            FILTER (
                Query1,
                Query1[Priority] = "PLI_NBD"
                    && Query1[SLA Status] = "FULFILLED"
                    && Query1[Exempted SLA] = "N"
            )
        )

         

        Regards,
        Harsh Nathani

        Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)