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
Theandster33
Frequent Visitor

Last Row of Data Based on Asset # and Date

Good Morning,

I am attempting to make a measure that displays the last row of data based on the latest date and the asset # of the machine. When this table has 100s of different rows for the same asset #s, I only want to display the most recent row for that asset # on a dashboard.This is what I have now where I am making individual measures for each status, operator, and description (so 12 measures in total) but I get this error.

 

Theandster33_0-1709302531635.png

Theandster33_1-1709302555220.png

If I get rid of the "&&" in my code (which I think is the problem) then I get a different error. 

 

Also if there is an easier way to do this without 12 separate measures that would be great too lol.

 

Thanks!

1 ACCEPTED SOLUTION

Hey fellas,

 

I ended up doing it a little differntly where I just made 4 different measures (everything but the asset #) to calculate the largest value for each of the columns in all of the datasets. 

Theandster33_2-1709558259695.png

 

Theandster33_1-1709558102076.png

This allows me to display the last data info put into the table for each asset # while also keeping the historical data.

Theandster33_3-1709558376193.png

 

Thanks for the help eveyone,

Andrew

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Theandster33 ,

This error message occurs because the Asset # column in your table is in numeric format, while "002498" in the dax expression is in text format. Therefore, you can change the Asset # column to text format (as shown in the figure below), or remove the double quotes of "002498" in the expression.

vkaiyuemsft_0-1709538217495.png


If this suggestion does not solve your problem, please upload a pbix attachment containing representative data and an example diagram of the expected results to better help you solve the problem.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey fellas,

 

I ended up doing it a little differntly where I just made 4 different measures (everything but the asset #) to calculate the largest value for each of the columns in all of the datasets. 

Theandster33_2-1709558259695.png

 

Theandster33_1-1709558102076.png

This allows me to display the last data info put into the table for each asset # while also keeping the historical data.

Theandster33_3-1709558376193.png

 

Thanks for the help eveyone,

Andrew

 

 

amitchandak
Super User
Super User

@Theandster33 , I can see you are creating a new column

 

The code for new column

=

var _max = maxx(filter(Table, [Asset #] = earlier([Asset #]) ), [Date])

return

Maxx(filter(Table, [Asset #] = earlier([Asset #]) &&  [Date]= _max ), [Status]) 

 

 

For Measure refer

Latest Date
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

Power BI Get the Last/Latest Value of a Category: https://www.youtube.com/watch?v=W4EF1f_k6iY

 

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors