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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
EnderWiggin
Helper I
Helper I

Count rows in minute interval and find maximum value

Dear All,

- I would like to ask your help to define the following measures. I created the timeNumber column for aggregation at the hour/minute level.

1. calculate the number of ID occurrences by date/hour/minute. (date/timeNumber)

2. determine the highest occurrence of IDs by date/hour/minute (date/timeNumber)

3.  determine the corresponding date and timeNumber values based on the highest occurrence of IDs in the entire collection

 

EnderWiggin_0-1740767239054.png

 

Thank you very much for your help in advance!

 

You can find the pbix file and the sample data here:

https://drive.google.com/file/d/1pa6dmdLbuaVPAyby7iYMDCUs9gHo5sZE/view?usp=sharing

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @EnderWiggin 

Please check this

 

Count_IDs = COUNT('sample'[id])
 
Max_ID_Occurrence =
MAXX(
    SUMMARIZE(
        'sample',
        'sample'[date],
        'sample'[timeNumber],
        "Count_ID", [Count_IDs]
    ),
    [Count_ID]
)
 
 
Max_Occurrence_DateTime =
VAR MaxCount = [Max_ID_Occurrence]
VAR MaxDateTime =
    TOPN(1,
        SUMMARIZE(
            'sample',
            'sample'[date],
            'sample'[timeNumber],
            "Count_ID", COUNT('sample'[id])
        ),
        [Count_ID],
        DESC
    )
RETURN
    CONCATENATEX(MaxDateTime, 'sample'[date] & " " & 'sample'[timeNumber], ", ")
A1.png
Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1740789306004.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

I tried your solution as well, and it works just as well as the one Techies sent earlier. Thank you for your help!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
techies
Super User
Super User

Hi @EnderWiggin 

Please check this

 

Count_IDs = COUNT('sample'[id])
 
Max_ID_Occurrence =
MAXX(
    SUMMARIZE(
        'sample',
        'sample'[date],
        'sample'[timeNumber],
        "Count_ID", [Count_IDs]
    ),
    [Count_ID]
)
 
 
Max_Occurrence_DateTime =
VAR MaxCount = [Max_ID_Occurrence]
VAR MaxDateTime =
    TOPN(1,
        SUMMARIZE(
            'sample',
            'sample'[date],
            'sample'[timeNumber],
            "Count_ID", COUNT('sample'[id])
        ),
        [Count_ID],
        DESC
    )
RETURN
    CONCATENATEX(MaxDateTime, 'sample'[date] & " " & 'sample'[timeNumber], ", ")
A1.png
Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

Hi techies,

thank you, this is what I was looking for!

ahmedoye
Responsive Resident
Responsive Resident

Hi, this question is not so clear as to what is required. If you could rephrase the requirements pls.

Hi amedoye,

thank you for your feedback and I'm sorry that I was not clear.

I added a picutre to the original post, I hope it helps.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.