Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
VeljkoP98
Frequent Visitor

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!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

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

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Try

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.