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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

return most recent data to identical ids


Hi,

I have these columns in my data source and I am trying to view the document that contains the most recent update.

Ex: I have a document DOC_ID = 4 and I want to bring the one with the most recent update date, for each different company. How could I do that in power bi?

I already looked for several ways to do it on websites and here in the community and I didn't get the result.
Thanks to anyone who can help

here's the Google Drive link with the pbi file to understand

 

https://drive.google.com/drive/folders/1dxg-LAkHZWWevyxKNIz41cOb9eEyFdkv 

 

DATECOMPANYDATAUPDATEDOC_IDNameDocDOCUMENTO_APROV_OBSDOCUMENTO_APROV_REGULARIZASTATUS
NULLANULLNULL NULLNULLOK
NULLANULLNULL NULLNULLOK 
2020-08-10 00:00:00.000A2020-09-16 12:21:44.4831DOC1NULLNULLOK 
2020-08-10 00:00:00.000A2020-09-16 12:21:33.3872DOC2NULLNULLOK 
2020-08-10 00:00:00.000A2020-09-16 12:21:52.4003DOC3NULLNULLOK 
2020-08-10 00:00:00.000A2020-09-16 12:22:00.6474DOC4NULLNULLNOT OK
2020-08-10 00:00:00.000A2020-09-16 12:22:09.4205DOC5Please post the collective agreement.send docNOT OK
2020-08-10 00:00:00.000A2020-09-16 12:22:18.3176DOC6Please post the collective agreement.send docNOT OK
2020-08-10 00:00:00.000A2020-09-16 12:22:26.6737DOC7NULLNULLNOT OK
2020-08-10 00:00:00.000A2020-09-16 12:22:35.9538DOC8NULLNULLNOT OK
2020-08-10 00:00:00.000A2020-11-16 12:22:46.0774DOC4NULLNULLNOT OK
2020-08-10 00:00:00.000A2020-11-16 12:22:56.3075DOC5NULLNULLNOT OK
2020-08-10 00:00:00.000A2020-11-16 12:23:05.9936DOC6NULLNULLOK
2020-08-10 00:00:00.000A2020-11-16 12:23:05.99413DOC13NULLNULLOK
2020-08-10 00:00:00.000A2020-11-16 12:23:05.99514DOC14NULLNULLOK
2020-08-10 00:00:00.000A2020-11-16 12:23:05.99615DOC15NULLNULLOK
2020-08-10 00:00:00.000A2020-11-16 12:23:05.99716DOC16NULLNULLOK
2020-08-10 00:00:00.000A2020-11-16 12:23:05.99817DOC17NULLNULLOK
2020-08-10 00:00:00.000B]18DOC18NULLNULLOK
2020-08-10 00:00:00.000B2020-09-16 12:24:21.61719DOC19NULLNULLOK
2020-08-10 00:00:00.000B2020-09-16 12:24:32.01323DOC23NULLNULLOK
3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , expected output is not very clear. But you can have status on the last date for doc like this

 

a new measure

Measure =
VAR __id = MAX ('Table'[DOC_ID] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[DOC_ID] = __id )
CALCULATE ( MAX ('Table'[STATUS] ), VALUES ('Table'[DOC_ID] ),'Table'[DOC_ID] = __id,'Table'[Date] = __date )

 

 

create measure for other columns

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

if you observe doc_id 4, 5, 6 are repeated for the filtered company in the month of August, the dateupdate is the date that had the modification of each. The visualization intended is to have these doc_id (example) appearing only once, according to the most recent dataupdate

 

Screenshot_7.png

Anonymous
Not applicable

I appreciate the help, but this measure has the wrong syntax when I make a measurement in power bi

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.