Reply
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

Hi, @Kaskazi_Network 

You may try formula as below:

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

 

Best Regards,
Community Support Team _ Eason

Syndicated - Outbound

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

Ashish_Mathur
Super User
Super User

Syndicated - Outbound

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

Syndicated - Outbound

@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.

Syndicated - Outbound

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.

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)