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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply

Sum of an individual distinct count

Hi everyone,
I have some data as represented in the dummy table below;

sales repskuQtypriceDate
Jamessku13207/28/2021
Jamessku12207/29/2021
Petersku25157/30/2021
Petersku14207/30/2021
Kensku33308/1/2021
Kensku25158/2/2021
Kensku23158/3/2021

My goal is to calculate the sum of  days worked for the three sales reps i.e James worked for 2 days, Peter worked for 1 and Ken worked for 3 days. So my total days worked would be 6. Getting for an individual is easy as I just do a distinct count of date. The question is how do I get the sum for the whole team?


Any help will be highly appreciated 

1 ACCEPTED SOLUTION

Hi, @Kaskazi_Network 

You may try formula as below:

Measure = COUNTROWS(SUMMARIZE('Table','Table'[Date],'Table'[full_name]))

 

Best Regards,
Community Support Team _ Eason

View solution in original post

7 REPLIES 7
v-easonf-msft
Community Support
Community Support

Hi,  @Kaskazi_Network 

Could you please tell me whether your problem has been solved?

If yes, you could accept the helpful answer as solution. You could also share your own solution here.
For now, there is no content of description in the thread. If you still need help, please share more details to us.

Best Regards,
Community Support Team _ Eason

I have not found a solution as yet. Here's how my data looks like;

Kaskazi_Network_0-1629190785258.png

Full names represents the sales reps. They are multiple working on the same day but not all work on a particular day. Kindly advise if you need more details on this..

Thanks

Hi, @Kaskazi_Network 

You may try formula as below:

Measure = COUNTROWS(SUMMARIZE('Table','Table'[Date],'Table'[full_name]))

 

Best Regards,
Community Support Team _ Eason

@v-easonf-msft This solved exact my problem. Thank you!

Ashish_Mathur
Super User
Super User

Hi,

The Distinctcount() function should work even for the entire team.  The result of that formula should be 6.

=distinctcount(data[date])


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

@Kaskazi_Network 
Right now each of the examples you share is on different days.

 

You can calculate the total days worked for the team by using a formula like this

 

CALCULATE (

DISTINCTCOUNT ( Table[Date] ),
ALL ( Table )
)

It will get more complicated if you have 2 Sales Reps who work on the same day.

Thank you for your response.
The formula however does not work for my dataset as I have multiple sales reps working on the same day.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

October NL Carousel

Fabric Community Update - October 2024

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