Forum Discussion

CV8's avatar
CV8
Regular Visitor
2 years ago
Solved

Need help on DAX for Status and Grouping

Hi,

 

I'm trying to find a DAX to help me count each type of status by each group.  This is an example of the data I'm starting with:

This is what I'm trying to get to:

 

 

  • hello CV8 

     

    please check if this accomodate your need.

     

    1. create new table with following DAX:

    Summarize =
    var _Group = SUMMARIZE('Table','Table'[Group])
    var _Status = SUMMARIZE('Table','Table'[Status])
    Return
    GENERATE(_Group,_Status)

     

    2. create calculated column for counting

    Count =
    var _Count = CALCULATE(COUNTROWS('Table'),FILTER('Table','Summarize'[Group]='Table'[Group]&&'Summarize'[Status]='Table'[Status]))
    Return
    IF(
        ISBLANK(_Count),
        0,
        _Count
    )

     

    Hope this will help you.

    Thank you.

3 Replies

  • hello CV8 

     

    please check if this accomodate your need.

     

    1. create new table with following DAX:

    Summarize =
    var _Group = SUMMARIZE('Table','Table'[Group])
    var _Status = SUMMARIZE('Table','Table'[Status])
    Return
    GENERATE(_Group,_Status)

     

    2. create calculated column for counting

    Count =
    var _Count = CALCULATE(COUNTROWS('Table'),FILTER('Table','Summarize'[Group]='Table'[Group]&&'Summarize'[Status]='Table'[Status]))
    Return
    IF(
        ISBLANK(_Count),
        0,
        _Count
    )

     

    Hope this will help you.

    Thank you.

  • CV8's avatar
    CV8
    Regular Visitor

    That worked.  Thank you!