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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
OUFores
Regular Visitor

Custom Column Count Exact Text String Occurrences Previous Minute

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:

TimestampText String ColumnNew Column with Count
6/28/2023 8:34:00     Apple3
6/28/2023 8:33:59Cherry2
6/28/2023 8:33:55Apple2
6/28/2023 8:33:35Apple1
6/28/2023 8:33:30Cherry1
6/28/2023 8:33:28Banana1

 

1 REPLY 1
Anonymous
Not applicable

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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