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

How to add latest data on map tooltip?

I'm using ArcGIS maps. I have 3 columns, region_name, temperature and date_time.

I want on the map, at the tooltip that appears when you hover your mouse over the bubble, for the latest temperature to appear for each region.

 

Write now when I add the Temperature column on the "tooltips", it shows me the sum of the temperature:

ss.png

What I want it to show is the temperature of the latest date and time on my table, for each region.

 

I know I can find the latest date and time by using Max function, but I don't know how to show the temperature of the rows that qualify. 

 

Thank you.

1 ACCEPTED SOLUTION

Hi @Georger2323 

 

Give this a go instead

Max Temp = 
VAR _last = { CALCULATE(
    MAX( 'Table'[date_time] ),
    ALL( 'Table'[date_time])
) } 
RETURN CALCULATE(
    MAX( 'Table'[temperature] ),
    TREATAS( _last, 'Table'[date_time] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

6 REPLIES 6
Mariusz
Community Champion
Community Champion

Hi @Georger2323 

 

Please see the below DAX measure, this should do the trick.

Measure = 
CALCULATE(
    MAX( 'Table'[temperature] ), 
    LASTDATE( 'Table'[date_time] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

@Mariusz 

 

I get the following error:

ss3.PNG

 

It's true that I have several date_times that are the same, because I have several regions. Each region has its own date_time. How could I fix this?

 

Thank you.

Hi @Georger2323 

 

Give this a go instead

Max Temp = 
VAR _last = { CALCULATE(
    MAX( 'Table'[date_time] ),
    ALL( 'Table'[date_time])
) } 
RETURN CALCULATE(
    MAX( 'Table'[temperature] ),
    TREATAS( _last, 'Table'[date_time] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

@Mariusz  Thank you so much, I appreciate it.

 

Would you mind explaining why your 2nd solution fixes the issue I had on your 1st one?

Hi @Georger2323 

No problem happy I could help.

 

For the explanation please refer to @v-frfei-msft  post.

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

Hi @Georger2323 ,

 

Refering to the document abouth LASTDATE. When the current context is a single date, the date returned by the FIRSTDATE and LASTDATE functions will be equal. That's why you got the error message.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.