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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
J_L
Frequent Visitor

Help with MAX date and time in column or measure

Hi team,

 

Hope you've all been well, all things considered.

 

I need help with finding the latest date and time from two related columns Date and Time. My desired outcome would be the third column MAX Date & Time 

 

DateTimeMAX Date & Time
11-Sep-2112:00 PM13/09/2021 16:00
11-Sep-2111:00 AM13/09/2021 16:00
11-Sep-212:00 PM13/09/2021 16:00
12-Sep-219:00 AM13/09/2021 16:00
12-Sep-216:00 AM13/09/2021 16:00
13-Sep-219:00 AM13/09/2021 16:00
13-Sep-214:00 PM13/09/2021 16:00
13-Sep-2112:00 PM13/09/2021 16:00

 

I've tried adding a column with the following measure Latest date and time = MAX((Query1.Date) &" "&(Query1.Time)) but it's not working. I can do this in excel no problems but not DAX/Power BI.

 

Thanks in advance for your help!!!

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@J_L Maybe:

Max Date & Time Column =
  VAR __MaxDate = MAX([Date])
  VAR __MaxTime = MAXX(FILTER('Table',[Date]=__MaxDate),[Time])
RETURN
  __MaxDate & " " & __MaxTime


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
J_L
Frequent Visitor

Thanks @Greg_Deckler !!! Much appreciated...  I was pulling my teeth out trying to work it out, also did lots of google searches too 😀

Greg_Deckler
Community Champion
Community Champion

@J_L Maybe:

Max Date & Time Column =
  VAR __MaxDate = MAX([Date])
  VAR __MaxTime = MAXX(FILTER('Table',[Date]=__MaxDate),[Time])
RETURN
  __MaxDate & " " & __MaxTime


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors