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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
NnIc0
Frequent Visitor

GROUP some values with IF time difference is more than 9 hour (540 minutes)

Hey guys,

 

I would like to put together this value (in red) if the time difference between 2 value (date/time) is more than 540 minutes.

 

i mean, if the past value have a difference of time more than 9 hours, group the [Event_Name] value the past and the next.


How I can do that ? 


Thanks in advance

Save.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Make a new column by using below functions :

 

TimeDiff =
VAR TimeNow =
    UTCNOW ()
VAR TimeDiff =
    DATEDIFF ( sv_update_date, TimeNow, MINUTE )
RETURN
    IF ( TimeDiff >= 540, CONCATENATE ( Event_Name, sv_update_date ), BLANK () )

 

 

Regards,

Gaurav Raj Singh

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

This should give sv_last_update for same even

maxx(filter(table,table[event_name]=earlier(table[event_name]) && table[sv_update_date]<earlier(table[sv_update_date])),table[sv_update_date])

 

This you can use to diff and calculate

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Make a new column by using below functions :

 

TimeDiff =
VAR TimeNow =
    UTCNOW ()
VAR TimeDiff =
    DATEDIFF ( sv_update_date, TimeNow, MINUTE )
RETURN
    IF ( TimeDiff >= 540, CONCATENATE ( Event_Name, sv_update_date ), BLANK () )

 

 

Regards,

Gaurav Raj Singh

JarroVGIT
Resident Rockstar
Resident Rockstar

Hi @NnIc0 ,

What do you mean by "group the [Event_Name] value the past and the next."  Can you give some sample data in a copyable table (never post pictures of your data, that doesn't let us copy it into power bi!) and the expected output? Do you expect a calculated table, a calculated column or some sort of measure? If so, how is that measure used, in what visuals etc?
Thanks!
Djerro123





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors