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
phaum1967
Resolver I
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

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
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

v-juanli-msft
Community Support
Community Support

Hi @phaum1967

“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]))

10.png

 

Best Regards

Maggie

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @phaum1967

“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]))

10.png

 

Best Regards

Maggie

Ashish_Mathur
Super User
Super User

Hi,

 

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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

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
https://www.linkedin.com/in/excelenthusiasts/

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.