Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |