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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How can I find the 5 most recent prices in a dataset?

I have a dataset in which I need to find the 5 most recent prices and display them in a table in Power BI. Here is a sample:

 

ItemDatePrice
Car1/1/20201
Car

1/2/2020

4.5
Car1/3/20205
Car1/4/20203.5
Car1/5/20204
Car1/6/20206

 

I would like to show 4.5, 5, 3.5, 4, and 6 in a table because those prices correspond to the 5 most recent dates. This will, of course, apply to multiple items, but this is a sampling.

7 REPLIES 7
Icey
Community Support
Community Support

Hi @Anonymous ,


Is this problem solved?


If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know.

 


Best Regards,
Icey

camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try it:

Capture.PNG

 

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



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

Proud to be a Super User!



Anonymous
Not applicable

@camargos88, this solved it! Thank you very much. I was able to add my fields to a Matrix and, with a few adjustments, create the desired result.

parry2k
Super User
Super User

@Anonymous use TOPN function, read this post.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k , thank you for the link. I have heard of both the RANK and TOPN functions, but I am unsure how to apply them in this scenario. They have always given me a bit of trouble.

@Anonymous that post clearly defined the steps, and I think you should be able to follow thru it.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k , I do appreciate the steps you sent and love Russo's work, but a post like this from an advanced DAX guru is only clear if (1) your use-case matches his closely (e.g., a Sum of values similar to sales), or (2) you have an inkling about how ISINSCOPE, CALCULATETABLE, ALLSELECTED, and the RANKX functions are operating in the formulae provided and also have a dataset that is aligned with this scenario.

 

I do not have either and have been unable to implement the steps listed. For one thing, it is quite hard if one does not know what to use in his own dataset to replace the fields in the DAX formulas.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors