Forum Discussion
Filter visuals with position data to show only current position per tracking unit
- 5 years ago
Hi olepropell ,
I created a slicer button and a measure to do this.
Create a table for the slicer mine has the following values:
Values
All Values Latest Values Now create the following measure:
Latest_Values = VAR temp_table = SUMMARIZE ( ALL ( 'Table'[TrackerID], 'Table'[Date], 'Table'[Lat], 'Table'[Long] ), 'Table'[TrackerID], "DATE", MAX ( 'Table'[Date] ) ) RETURN SWITCH ( SELECTEDVALUE ( 'Period Selection'[Values] ), "All Values", 1, IF ( SELECTEDVALUE ( 'Table'[Date] ) = MAXX ( FILTER ( temp_table, 'Table'[TrackerID] = MAX ( 'Table'[TrackerID] ) ), [DATE] ), 1 ) )Now add this has filter on your visualizations and select all non blank vlaues
Result below and in attach PBIX file.
Hi olepropell ,
I created a slicer button and a measure to do this.
Create a table for the slicer mine has the following values:
Values
| All Values |
| Latest Values |
Now create the following measure:
Latest_Values =
VAR temp_table =
SUMMARIZE (
ALL ( 'Table'[TrackerID], 'Table'[Date], 'Table'[Lat], 'Table'[Long] ),
'Table'[TrackerID],
"DATE", MAX ( 'Table'[Date] )
)
RETURN
SWITCH (
SELECTEDVALUE ( 'Period Selection'[Values] ),
"All Values", 1,
IF (
SELECTEDVALUE ( 'Table'[Date] )
= MAXX (
FILTER ( temp_table, 'Table'[TrackerID] = MAX ( 'Table'[TrackerID] ) ),
[DATE]
),
1
)
)
Now add this has filter on your visualizations and select all non blank vlaues
Result below and in attach PBIX file.
Hi MFelix.
This really helped and I am trying to implement this into my model now. Just to check: The temp table in the measure must be built with all columns I want to use in my visuals, correct?
In my example each tracking also have data for Knots, Course, Battery, Transport and Trigger.
- MFelix5 years ago
Super User
Hi olepropell ,
Not necessarily, you must use the ones that give you most information you need in this case the date, lat, long and ID, should be enough, if you see this does not return expected result then add the rest of the columns.