Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a dataset and need to create a new column that counts the occurrences from a separate column for the previous minute from most recent occurrence. What is the easiest way to do this?
This is an example:
Timestamp | Text String Column | New Column with Count |
6/28/2023 8:34:00 | Apple | 3 |
6/28/2023 8:33:59 | Cherry | 2 |
6/28/2023 8:33:55 | Apple | 2 |
6/28/2023 8:33:35 | Apple | 1 |
6/28/2023 8:33:30 | Cherry | 1 |
6/28/2023 8:33:28 | Banana | 1 |
Hi @OUFores,
You can try to use the following formula if it suitable for your requirement:
formula =
CALCULATE (
COUNTROWS ( TableName ),
FILTER (
TableName,
TableName[Text String] = EARLIER ( TableName[Text String] )
&& TableName[Timestamp]
>= MAX ( TableName[Timestamp] ) - TIME ( 0, 1, 0 )
)
)
Regards,
Xiaoxin Sheng
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |