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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Get Last Values from a Table

Hello.

From my CRM I am obtaining information that I must graph. I need to have for each customer the latest value for various attributes. Working with the information I finally have a table that contains accountid (the client), attribute (the various attributes), cretatedon (the date of change), newname (the value of that attribute) and Index (column added by me after sorting the changes by date.

I have tried to do it in various ways and I am not getting the data, could you help me?

Thanks a lot

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Syndicate_Admin 

Create a Calculated Column to Identify the Latest Record:

LatestRecord =
RANKX(
FILTER(
TableName,
TableName[accountid] = EARLIER(TableName[accountid]) &&
TableName[attribute] = EARLIER(TableName[attribute])
),
TableName[createdon],
,
DESC
)

 

Then, you can create a filtered table or measure to get only the latest records where the rank is 1.

LatestValuesTable =
FILTER(
TableName,
TableName[LatestRecord] = 1
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Syndicate_Admin 

Create a Calculated Column to Identify the Latest Record:

LatestRecord =
RANKX(
FILTER(
TableName,
TableName[accountid] = EARLIER(TableName[accountid]) &&
TableName[attribute] = EARLIER(TableName[attribute])
),
TableName[createdon],
,
DESC
)

 

Then, you can create a filtered table or measure to get only the latest records where the rank is 1.

LatestValuesTable =
FILTER(
TableName,
TableName[LatestRecord] = 1
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.