Forum Discussion
Power Query Top N Filter
Anonymous
You can add a new step as follows, replace PreviousStep with the relevant step name as per your file.
= Table.LastN (PreviousStep, 10)
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply š
- Anonymous2 years agoNot applicable
This was perfect, Thanks!
I just needed to sort my rows appropriately prior.
- Fowmy2 years agoSuper User
Anonymous
Glad it works for you!
Please accept my solution as the answer, it will be helpful for others who have similar issues.
- Anonymous5 years agoNot applicable
Thanks for your quick response! I think Table.LastN will give just the number of rows to keep (or am I totally misreading that?). I don't know what the total number of rows that each DataSetKey will be, so I don't think this way will work.
I'll try to reword my question a bit. Each row has a identifier, refering to what data set each row belongs to. What would be a good way to only load the last 10 of the DataSetKey, without knowing how many rows are going to be queried? So what I'd want to do is bring in the top 10 DataSetKey values without knowing what the max value of the DataSetKey is or the number of rows that'd I'd expect, if all that makes sense.
- edhans5 years agoCommunity Champion
Anonymous if mahoneypat 's answer isn't your solution, can you supply some sample data with expected results. You have to remember no one here knows anything about your tables. See links below for instructions.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.