Forum Discussion
Count distinct dates against unique User name
Hi Im super new to the community.
I am trying to calculate how many meetings my agents are conducting in a month - and not count multiple meetings they are doing.
Eg.
1) Shahid meets 5 people on 10th Oct and then he meets 8 more people on 22nd Oct, i want to count it as two active meeting days in month.
Could you please help create a measure for this?
| S. No | Date | Agent Name |
| 1 | 17/09/2022 | Shahid Bhutto |
| 2 | 17/09/2022 | Shahid Bhutto |
| 3 | 17/09/2022 | Shahid Bhutto |
| 4 | 17/09/2022 | Shahid Bhutto |
| 5 | 17/09/2022 | Shahid Bhutto |
| 6 | 17/09/2022 | Shahid Bhutto |
| 7 | 27/09/2022 | Shahid Bhutto |
| 8 | 27/09/2022 | Shahid Bhutto |
| 9 | 27/09/2022 | Shahid Bhutto |
| 10 | 27/09/2022 | Shahid Bhutto |
| 11 | 10/10/2022 | Ali Gohar |
| 12 | 25/10/2022 | Mohammad Idrees |
| 13 | 19/10/2022 | Ali Gohar |
| 14 | 22/10/2022 | Barkat Ali |
| 15 | 15/10/2022 | Barkat Ali |
| 16 | 22/10/2022 | Barkat Ali |
| 17 | 27/10/2022 | Barkat Ali |
| 18 | 15/10/2022 | Barkat Ali |
| 19 | 22/10/2022 | Barkat Ali |
| 20 | 15/10/2022 | Barkat Ali |
Supposing your table named Data, try to create a new table with the code below:
Table =
VAR _table =
SUMMARIZE (
Data,
Data[Date],
Data[Agent Name]
)
RETURN
ADDCOLUMNS (
_table,
"Count",
CALCULATE (COUNT(Data[S. No]))
)
5 Replies
- FreemanZ
Super User
Supposing your table named Data, try to create a new table with the code below:
Table =
VAR _table =
SUMMARIZE (
Data,
Data[Date],
Data[Agent Name]
)
RETURN
ADDCOLUMNS (
_table,
"Count",
CALCULATE (COUNT(Data[S. No]))
)
- samadkhaanNew Member
Thank you. it worked 🙂
- ankit3977Frequent Visitor
I am try same funcation but not getting result, When I am try to add same then I am getting error for multiplace time coulumns cannot be conveted.
My problem is
I have data when we have many member and those worked on many task on same on different date. Now I want to count number of days by members So could please guide me how I can add measure to find out number of days work by members?
- mh2587
Super User
Measure = DISTINCTCOUNT(TABLE NAME[DATES])
- samadkhaanNew Member
Hasnain, it is just counting all the dates. I want to count unique date agaisnt each Agent.