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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Yumikang
Helper II
Helper II

How do you count a similar time to 1 time?

Hi all,

I recently had a hard time.I need some help.

Use the count function to find that the time that is a few seconds apart is counted separately when counting the number of times.But for me, within a minute, they can be counted as one.

Yumikang_0-1721977545728.png

 

How do I design a measure?I can't use the count function and the count rows function to achieve satisfactory results.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Yumikang 

you can create a new column

 

Column =
VAR _last=maxx(FILTER('Table','Table'[entry time]<EARLIER('Table'[entry time])),'Table'[entry time])
return if(ISBLANK(_last),'Table'[entry time],if(DATEDIFF(_last,'Table'[entry time],SECOND)<=60,_last,'Table'[entry time]))
 
11.PNG
 
then DISTINCTCOUNT the new column




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
rajendraongole1
Super User
Super User

Hi @Yumikang - Create a calculated column on your existing tables as below minuteinterval column:

MinuteInterval =
VAR DateTimeValue = [Timestamp]
RETURN
    DATE(
        YEAR(DateTimeValue),
        MONTH(DateTimeValue),
        DAY(DateTimeValue)
    ) + TIME(
        HOUR(DateTimeValue),
        MINUTE(DateTimeValue),
        0
    )

 

rajendraongole1_0-1721979495452.png

 

Create a measure to find the distint count on the top of the column as below:

EventCountWithinMinute =
CALCULATE(
    DISTINCTCOUNT('Entry Date'[MinuteInterval]),
    FILTER(
        'Entry Date',
        'Entry Date'[MinuteInterval] <= MAX('Entry Date'[MinuteInterval])
    )
)
 
 
Hope it works
 
rajendraongole1_1-1721979597461.png

 

 
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





sorry i need the 2 show as 1 time

Yumikang_0-1721982278712.png

 

ryan_mayu
Super User
Super User

@Yumikang 

you can create a new column

 

Column =
VAR _last=maxx(FILTER('Table','Table'[entry time]<EARLIER('Table'[entry time])),'Table'[entry time])
return if(ISBLANK(_last),'Table'[entry time],if(DATEDIFF(_last,'Table'[entry time],SECOND)<=60,_last,'Table'[entry time]))
 
11.PNG
 
then DISTINCTCOUNT the new column




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yes, thank you very much for your guidance. I've added a new "time column" of values that meets my requirements.

Now I have a new requirement to create a new measure to calculate the number of times a name is showed. if the "time column" is the same, then the name is also counted 1 time. If the "time column" is not the same, then count the name showed times nomatter the name is same. If the name is blank, it will not be counted.

Yumikang_1-1721982155668.png

 

Yumikang_0-1721982092067.png

 

then you can try to DISTINCTCOUNT the time column.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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