Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello everybody,
I have this kind of table with two columns : userId and date Time of activity :
| userId | activity date/time |
| id1 | 14/01/2021 06:52 |
| id1 | 04/01/2021 07:47 |
| id1 | 04/01/2021 07:26 |
| id2 | 23/12/2020 19:05 |
| id2 | 17/12/2020 14:24 |
| id2 | 13/12/2020 15:23 |
| id3 | 22/12/2020 21:05 |
| id3 | 22/12/2020 17:52 |
| id3 | 16/12/2020 20:38 |
| id3 | 15/12/2020 15:43 |
| id3 | 11/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 :
| userId | activity date/time | nbr activity per day |
| id1 | 14/01/2021 06:52 | 1 |
| id1 | 04/01/2021 07:47 | 2 |
| id1 | 04/01/2021 07:26 | 2 |
| id2 | 23/12/2020 19:05 | 1 |
| id2 | 17/12/2020 14:24 | 1 |
| id2 | 13/12/2020 15:23 | 1 |
| id3 | 22/12/2020 21:05 | 2 |
| id3 | 22/12/2020 17:52 | 2 |
| id3 | 16/12/2020 20:38 | 1 |
| id3 | 15/12/2020 15:43 | 1 |
| id3 | 11/12/2020 15:17 | 1 |
Any idea please to do that ? Thank you for your help.
Best,
Solved! Go to Solution.
@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]))
@Anonymous ,
First create Calculated column to extract only Date part from Activity Datetime Column:
@Anonymous ,
First create Calculated column to extract only Date part from Activity Datetime Column:
@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]))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |