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
abbas_uddin
Helper I
Helper I

Max Datetime by User with Coordinates

Dear Experts,

 

 I have a table in which User-ID, Recorded Datetime and coordinates are showing. Now i want to show only the max of datetime in the Maps visuals with coordinates. the data below is like this:

Consultant IDDatetimeStart Time LatitudeStart Time Longitude
A-116/8/2021 10:5925.233984355.3203666
A-116/8/2021 13:0825.233955555.3203741
A-116/8/2021 13:3425.233968955.3203736
A-116/9/2021 7:3525.234111455.3190147
A-116/9/2021 10:2825.233945255.3203874
B-206/8/2021 10:1725.3086978255.40167385
B-206/8/2021 14:0725.30856355.40197406
B-206/8/2021 14:2025.3085206255.40203467
B-206/8/2021 15:0225.3085571455.40198429
B-206/8/2021 17:2825.3085359155.40198806
B-206/8/2021 17:2825.3085575855.40196614
C-436/9/2021 9:2925.3344946355.38996968
C-436/9/2021 10:1725.333837555.38976669
A-2206/7/2021 19:4125.2001087755.275296
A-2206/8/2021 10:5425.20007255.2753205

 

The result which i expect is UserID, Max of time, and coordinate as follows:

 

USER IDDate TimeLatitudeLongitude
A-116/9/2021 10:2825.233945255.3203874
B-206/8/2021 17:2825.3085575855.40196614
C-436/9/2021 10:1725.333837555.38976669
A-2206/8/2021 10:5425.20007255.2753205

 

how to achieve this. i Tried creating new table with Summarize and calculate max but doesnt seem to work for me or i am not doing it right,

 

kindly help

 

regards,

Abbas

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @abbas_uddin 

Please try the below for creating a new table.

 

New Table =
SUMMARIZECOLUMNS (
'Table'[Consultant ID],
'Table'[Datetime],
'Table'[Latitude],
'Table'[Longitude],
FILTER (
'Table',
'Table'[Datetime]
= CALCULATE (
MAX ( 'Table'[Datetime] ),
ALLEXCEPT ( 'Table', 'Table'[Consultant ID] )
)
)
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @abbas_uddin 

Please try the below for creating a new table.

 

New Table =
SUMMARIZECOLUMNS (
'Table'[Consultant ID],
'Table'[Datetime],
'Table'[Latitude],
'Table'[Longitude],
FILTER (
'Table',
'Table'[Datetime]
= CALCULATE (
MAX ( 'Table'[Datetime] ),
ALLEXCEPT ( 'Table', 'Table'[Consultant ID] )
)
)
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@abbas_uddin , Try to add a measure like the first one and try

 

cnt =
VAR __id = MAX ('Table'[USER ID ] )
VAR __date = CALCULATE ( MAX('Table'[Date Time] ), ALLSELECTED ('Table' ), 'Table'[USER ID] = __id )
CALCULATE ( count ('Table'[USER ID] ), VALUES ('Table'[USER ID] ),'Table'[USER ID] = __id,'Table'[Date Time] = __date )

 

if needed have measure for long/lat

Longitude =
VAR __id = MAX ('Table'[USER ID ] )
VAR __date = CALCULATE ( MAX('Table'[Date Time] ), ALLSELECTED ('Table' ), 'Table'[USER ID] = __id )
CALCULATE ( max ('Table'[Longitude] ), VALUES ('Table'[USER ID] ),'Table'[USER ID] = __id,'Table'[Date Time] = __date )

Latitude =
VAR __id = MAX ('Table'[USER ID ] )
VAR __date = CALCULATE ( MAX('Table'[Date Time] ), ALLSELECTED ('Table' ), 'Table'[USER ID] = __id )
CALCULATE ( max ('Table'[Longitude] ), VALUES ('Table'[USER ID] ),'Table'[USER ID] = __id,'Table'[Date Time] = __date )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.