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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.