Forum Discussion

joepcf's avatar
joepcf
New Member
6 years ago
Solved

Create a column using the latest value from a table

Hi,

 

Any help you can give on this would be greatly appreciated. 

 

I am looking to create a new column on a table that will show the most recent Name value using the URL. Here is my current dataset: 

 

IDTimestampNameURL
129/06/2020Page 1http://www.web.com/page1
230/06/2020Page 1.1http://www.web.com/page1
330/06/2020Page 2http://www.web.com/page2
41/07/2020Page 2.1http://www.web.com/page2
52/07/2020Page 2.2http://www.web.com/page2

 

I would like to output the following:

 

IDTimestampNameURLLatestName
129/06/2020Page 1http://www.web.com/page1Page 1.1
230/06/2020Page 1.1http://www.web.com/page1Page 1.1
330/06/2020Page 2http://www.web.com/page2Page 2.2
41/07/2020Page 2.1http://www.web.com/page2Page 2.2
52/07/2020Page 2.2http://www.web.com/page2Page 2.2

 

The LatestName column should look for the URLs that match and find the most recent item and use that Name value. Any ideas?

 

  • joepcf 

    Please try

    Column = 
    MAXX(FILTER('table','table'[URL]=EARLIER('table'[URL])&&'table'[ID]=CALCULATE(MAX('table'[ID]),ALLEXCEPT('table','table'[URL]))),'table'[LatestName])

4 Replies

  • joepcf 

    Please try

    Column = 
    MAXX(FILTER('table','table'[URL]=EARLIER('table'[URL])&&'table'[ID]=CALCULATE(MAX('table'[ID]),ALLEXCEPT('table','table'[URL]))),'table'[LatestName])

    • joepcf's avatar
      joepcf
      New Member

      Hi amitchandak - thanks for your response.

       

      The page names may well be random values - "MY content page", "News article ABC", etc. etc. - so I need to use the URL as the key.