The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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!
Solved! Go to 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.
This allows me to display the last data info put into the table for each asset # while also keeping the historical data.
Thanks for the help eveyone,
Andrew
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.
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.
This allows me to display the last data info put into the table for each asset # while also keeping the historical data.
Thanks for the help eveyone,
Andrew
@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
Power BI Get the Last/Latest Value of a Category: https://www.youtube.com/watch?v=W4EF1f_k6iY