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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

To show the latest location on map

I have a machine working in Germany last month and working in France this month. How to show only France on Map.

Machine TypeLocationDate
Truck 001Germany

2019/11/11

Truck 001France2019/12/12

My data table is like above. Thank you very much for your help.

2 ACCEPTED SOLUTIONS

You haven't mentioned FILTER in the formula.
See below:
CALCULATE(MIN(Maps[Location]),FILTER(Maps,Maps[Date]=LatestDate && Maps[Location]=Location))

The higlighted part needs to be in the query.

View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

 

Please refer to the calculated culumn below and see if the result achieve your expectation.

Column = 
VAR a =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Machine Type] = EARLIER ( 'Table'[Machine Type] ) )
    )
RETURN
    IF ( 'Table'[Date] = a, 'Table'[Location], BLANK () )

Here's my sample data and the result would be shown as below.

 1.PNG2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Please refer to the calculated culumn below and see if the result achieve your expectation.

Column = 
VAR a =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Machine Type] = EARLIER ( 'Table'[Machine Type] ) )
    )
RETURN
    IF ( 'Table'[Date] = a, 'Table'[Location], BLANK () )

Here's my sample data and the result would be shown as below.

 1.PNG2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rajulshah
Resident Rockstar
Resident Rockstar

Hello @Anonymous ,

 

You can create a calculated column that fetches only the latest location and then use that column in the map visual.

Hope this helps.

Let me know if this didn't help.

Anonymous
Not applicable

Hi

 

Thanks for your reply.

What's the dax function for this?

Hey, 

You can use the following DAX function here:

Latest Location = 
VAR LatestDate = CALCULATE(LASTDATE(Maps[Date]),FILTER(Maps,Maps[Machine Type]=EARLIER(Maps[Machine Type])))
VAR Location = Maps[Location]
RETURN CALCULATE(MIN(Maps[Location]),FILTER(Maps,Maps[Date]=LatestDate && Maps[Location]=Location))


Please see the following image:

latestlocation.png

Hope this helps.

Anonymous
Not applicable

Untitled picture.png

Hi,

Please have a look at above pic. I followed your steps, but got error. what's the problem?

You haven't mentioned FILTER in the formula.
See below:
CALCULATE(MIN(Maps[Location]),FILTER(Maps,Maps[Date]=LatestDate && Maps[Location]=Location))

The higlighted part needs to be in the query.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.