cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Resolver I

## Distinctcount linked to another column

Hi PowerBI community

I have a table like this:

column nme :  Speciality, Date of operation,...

I want to have a distinctcount on date in order to count all different dates for each speciality.

Of course If I do a distinctcount(date) it does not work as it will count all dates but without taking account my need of have number of date by specilaity.

I tried calculcate(distinctount(date); speciality) but it does nothing.

Any help is welcome...

2 ACCEPTED SOLUTIONS
Super User

Hi,

You should drag speciality to the X axis of the Graph and then drag the Distinctcount measure to the value section.  Anyways, if you want to write a formula, write this measure:

=CALCULATE(DISTINCTCOUNT(Data[Date of operation]),Data[Speciality]="XXX")

Replace XXX with the specific speciality.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Community Support

“have a distinctcount on date in order to count all different dates for each speciality”

To achieve requirement above, create a column

`Column = CALCULATE(DISTINCTCOUNT(Sheet1[Date of operation]),ALLEXCEPT(Sheet1,Sheet1[Speciality]))`

Best Regards

Maggie

4 REPLIES 4
Community Support

“have a distinctcount on date in order to count all different dates for each speciality”

To achieve requirement above, create a column

`Column = CALCULATE(DISTINCTCOUNT(Sheet1[Date of operation]),ALLEXCEPT(Sheet1,Sheet1[Speciality]))`

Best Regards

Maggie

Super User

Hi,

Write the normal distinctcount function and in the filter/slicer, select any speciality.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Resolver I

Thanks but I want to present datas in a graph that show monthly activities per speciality. So slicer does not help.

An other idea?

thanks

Super User

Hi,

You should drag speciality to the X axis of the Graph and then drag the Distinctcount measure to the value section.  Anyways, if you want to write a formula, write this measure:

=CALCULATE(DISTINCTCOUNT(Data[Date of operation]),Data[Speciality]="XXX")

Replace XXX with the specific speciality.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors