Forum Discussion

VeljkoP98's avatar
VeljkoP98
Frequent Visitor
3 years ago
Solved

Distinct count by Group

BookStoryGenreCount Historical
Book 1Story1Horror0
Book 1Story2Romance0
Book 1Story3Romance0
Book 2Story4Historical3
Book 2Story5Historical3
Book 2Story6Historical3

 

I would like to figure out how to have Additional column in which i would have for each book, number of Historical stories?

I don't know how to do count by GROUP.

Thanks for answers in advance!

  • Try

    Count historical =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLEXCEPT ( 'Table', 'Table'[Book] ),
        'Table'[Genre] = "Historical"
    )
    

1 Reply

  • Try

    Count historical =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLEXCEPT ( 'Table', 'Table'[Book] ),
        'Table'[Genre] = "Historical"
    )