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
joepcf
New Member

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?

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@joepcf 

Please try

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

1.PNG





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@joepcf 

Please try

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

1.PNG





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

Proud to be a Super User!




That works great - thanks a lot @ryan_mayu 

amitchandak
Super User
Super User

@joepcf , Try as new columns

LatestName =

if(not(containsstring([name],".")) ,[Name]&".1",[Name])

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. 

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.