cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mattthew
Frequent Visitor

Shape Map Legend Latest Year

I have a county shape map with a legend by year.  A county can have multiple values from different years (2016, 2017, 2018, 2019, etc).  How can I have the map show the latest year color?  It seems to color code based on the earliest year from what I can tell.  Thanks. 

2 ACCEPTED SOLUTIONS
v-kelly-msft
Community Support
Community Support

Hi @mattthew ,

 

Create a column similarly as below:

maxyear = MAXX(ALL(Table8a),'Table8a'[Year])

And you will see:

 

vkellymsft_2-1626330270573.png

 

For my sample .pbix file,pls see attached.

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

Hi @v-kelly-msft , thanks for the reference.  This put me down a path of reviewing maxx and it looked like what I was seeking blogenterprisedna had documentation for.  

 

https://blog.enterprisedna.co/using-the-maxx-dax-function-in-power-bi-to-calculate-recent-values-in-...

 

For those not wanting to click on the url the solution is:

Max Date = 

VAR CurrentName = 'Dataset'[Name] 

 

RETURN

MAXX(

   FILTER( ALL('Dataset'), 'Dataset'[Name] = CurrentName ) , 

     'Dataset'[Date Taken]')

 

Then placing Max Date in the legend.  

 

Thanks Again!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @mattthew ,

 

Create a column similarly as below:

maxyear = MAXX(ALL(Table8a),'Table8a'[Year])

And you will see:

 

vkellymsft_2-1626330270573.png

 

For my sample .pbix file,pls see attached.

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

Hi @v-kelly-msft , thanks for the reference.  This put me down a path of reviewing maxx and it looked like what I was seeking blogenterprisedna had documentation for.  

 

https://blog.enterprisedna.co/using-the-maxx-dax-function-in-power-bi-to-calculate-recent-values-in-...

 

For those not wanting to click on the url the solution is:

Max Date = 

VAR CurrentName = 'Dataset'[Name] 

 

RETURN

MAXX(

   FILTER( ALL('Dataset'), 'Dataset'[Name] = CurrentName ) , 

     'Dataset'[Date Taken]')

 

Then placing Max Date in the legend.  

 

Thanks Again!

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors