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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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