Forum Discussion

JYPARK's avatar
JYPARK
Frequent Visitor
7 years ago

Sum Group by type

Hi everyone,

 

Seeking for assistance.   I am trying to sum up the number of failure types.  However, I am not sure how I can do this.  

 

5 Replies

  • Cmcmahan's avatar
    Cmcmahan
    Resident Rockstar

    You're just trying to count how many distinct item_failure_types you have? That's easy enough:

    FailureTypes = DISTINCTCOUNT('Table 1'[item_failure_type])

      

    • JYPARK's avatar
      JYPARK
      Frequent Visitor

      I tried this method but when I select "New Column" and enter this 

      FailureTypes = DISTINCTCOUNT('item_registration'[item_failure_type])
      I get this error message:





      • Cmcmahan's avatar
        Cmcmahan
        Resident Rockstar

        Don't try and create this as a new column.  Create it as a new measure.

  • v-xuding-msft's avatar
    v-xuding-msft
    Community Support

    Hi JYPARK ,

    You could try the formula if you want to count the number of failure types based on item id.

    Measure  = CALCULATE(DISTINCTCOUNT('Table '[failure types]),ALLEXCEPT('Table ','Table '[item id]))

    Best Regards,

    Xue Ding

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