Forum Discussion
rahul632soni
Helper I
3 years agoHow to get Latest Location and Total Engine hours
Hey Community SO i Have a table which Consist of 15 Coulmns , Out of Which Few columns are Vin (Vehicle Identification Number),gps_timestamp(timestamp at which data recorded),engine hours (Current E...
Anonymous
3 years agoNot applicable
Hi rahul632soni ,
1. Please try to create measure with below dax formula:
latest_position_lat =
VAR _vin =
SELECTEDVALUE ( 'Table'[vin] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [vin] = _vin )
VAR _max =
MAXX ( tmp, [gps_timestamp] )
VAR _val =
CALCULATE ( MAX ( [position_lat] ), FILTER ( tmp, [gps_timestamp] = _max ) )
RETURN
_val
latest_position_lon =
VAR _vin =
SELECTEDVALUE ( 'Table'[vin] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [vin] = _vin )
VAR _max =
MAXX ( tmp, [gps_timestamp] )
VAR _val =
CALCULATE ( MAX ( [position_lon] ), FILTER ( tmp, [gps_timestamp] = _max ) )
RETURN
_val
total engin hours =
VAR _vin =
SELECTEDVALUE ( 'Table'[vin] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [vin] = _vin )
RETURN
SUMX ( tmp, [ENG_HOURS] )
2. add a table visual with filed and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rahul632soni
Helper I
3 years agoAnonymous
Hello Thakns For Solution ,
However now thw things is, it has become a measure to calculate last Lat ans Lon so how would i use this to greate a map , What i wanted is to show the latest location of each machines .
Currently when i ma trying to plot map its not happening .
Thanks.