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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PBI5851
Helper V
Helper V

Count Days from a Table

Hello,

 I have a requriement to capture how many days a rep is active per month. The rep can have multiple rows in a single day as there are other fields (such as status and categories etc). 

 

JobIDDateRep
J2239/1/2020Mak
J2249/1/2020Steve
J2259/1/2020Shawn
J2269/1/2020Mak
J2279/2/2020Jennifer
J2289/3/2020Shawn
J2299/3/2020Mary
J2309/3/2020Mary
J2319/3/2020Shawn
J2329/5/2020Mal
J2339/5/2020Mak
J2349/5/2020Mak
J2359/5/2020Mak
J2369/5/2020Shawn
J2379/5/2020Steve
J2389/10/2020Jennifer
J2399/10/2020Mary
J2409/10/2020Keith

 

I intend to get the below result

Jennifer2
Keith1
Mak2
Mal1
Mary2
Shawn3
Steve2

Which shows the unique number of days the rep has been active. I was thinking of distinct count of days, but not sure how to count that. When i do a count(date), i get a ridiculously long number. 

 

Any other recommendations on how to achieve this ?

4 REPLIES 4
Anonymous
Not applicable

Hello to PBI5851,

There are two ways to get the effect of your question request:

1. Create a column

Month_day =
CALCULATE(DISTINCTCOUNT('Table'[Date]),ALLEXCEPT('Table','Table'[Rep]))

Result:

v-yangliu-msft_0-1602661762232.png

2. Create a measure and form a card to view it.

Measure:
Count = DISTINCTCOUNT('Table'[Date])

Form a Rep-based cutter and a custom-based Card:

Result:

v-yangliu-msft_1-1602661762239.png

Best regards

Liu Yang

If this post helps,then consider Accepting it as the solution to help other members find it faster.

Ashish_Mathur
Super User
Super User

Hi,

Try this.  Drag Rep to the table visual and write this measure

=distinctcount(data[date])

Hope this helps.


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

@Ashish_Mathur , is there a way to achieve this without displaying the Rep Name. There is a visual need to do a company target and dept target. So i should get 13 for the month and display just that value on a card or subsequent visuals with further calculations. 

Hi,

Remove Rep from the visual and change the visual to a card visual.


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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors