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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Count activity per Day

Hello everybody,

 

I have this kind of table with two columns : userId and date Time of activity : 

userIdactivity date/time
id114/01/2021 06:52
id104/01/2021 07:47
id104/01/2021 07:26
id223/12/2020 19:05
id217/12/2020 14:24
id213/12/2020 15:23
id322/12/2020 21:05
id322/12/2020 17:52
id316/12/2020 20:38
id315/12/2020 15:43
id311/12/2020 15:17

 

That, I want to add a column with the number of activity per day for each user, look the table below : 

userIdactivity date/timenbr activity per day
id114/01/2021 06:521
id104/01/2021 07:472
id104/01/2021 07:262
id223/12/2020 19:051
id217/12/2020 14:241
id213/12/2020 15:231
id322/12/2020 21:052
id322/12/2020 17:522
id316/12/2020 20:381
id315/12/2020 15:431
id311/12/2020 15:171

 

Any idea please to do that ? Thank you for your help.

 

Best,

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a date column from datetime and then try this column

 

countx(filter(Table, [userId] = earlier([userId]) && [date] = earlier([date])),[userId])

 

 

date columns

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Tahreem24
Super User
Super User

@Anonymous ,

First create Calculated column to extract only Date part from Activity Datetime Column:

Date Column = FORMAT(Master[activity date/time],"DD/MMM/YYYY")
 
Then Create measure to count based on newly created Date Column:
Measure = CALCULATE(COUNT(Master[userId]),ALLEXCEPT(Master,Master[Date Column]))
 
Screen shot attached:
Capture.PNG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

2 REPLIES 2
Tahreem24
Super User
Super User

@Anonymous ,

First create Calculated column to extract only Date part from Activity Datetime Column:

Date Column = FORMAT(Master[activity date/time],"DD/MMM/YYYY")
 
Then Create measure to count based on newly created Date Column:
Measure = CALCULATE(COUNT(Master[userId]),ALLEXCEPT(Master,Master[Date Column]))
 
Screen shot attached:
Capture.PNG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Anonymous , Create a date column from datetime and then try this column

 

countx(filter(Table, [userId] = earlier([userId]) && [date] = earlier([date])),[userId])

 

 

date columns

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.