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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


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 )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors