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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

Top Solution Authors