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
houssamedd
New Member

DISTINCT COUNT AND GROUP BY

Good morning Power BI community!

I have been running through some problems creating the correct measure, and I'm wondering if you guys can help.

 

I have a table that goes like this:

Capture.PNG

I created a measure which is a count distinct of books per writer per publishing house.

Now, what I would like to do is to create a measure which is a distinct count of books per publishing house and have both the measures in the same table.

The desired table is the following:

 

Capture expec.PNG

Thank you in advance for your suggestions/answers!

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @houssamedd,

 

Try this formula, please. BTW, the first need doesn't need a measure. Try the built-in calculation.

Measure =
CALCULATE (
    DISTINCTCOUNT ( Table1[Book] ),
    ALLEXCEPT ( Table1, Table1[publishing house] )
)

DISTINCT-COUNT-AND-GROUP-BY

Best Regards,
Dale

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

View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @houssamedd,

 

Try this formula, please. BTW, the first need doesn't need a measure. Try the built-in calculation.

Measure =
CALCULATE (
    DISTINCTCOUNT ( Table1[Book] ),
    ALLEXCEPT ( Table1, Table1[publishing house] )
)

DISTINCT-COUNT-AND-GROUP-BY

Best Regards,
Dale

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

Perfect, this worked.

Thank you Dale!

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.