Showing results for 
Search instead for 
Did you mean: 
Resolver I
Resolver I

Displaying distinct items sorted by soonest month

Afternoon all,


I'm looking to display two columns ("Month", "FAQ Item Name") from a SharePoint list that contains information about when certain reports are updated for an information app i'm creating.

I need to see a distinct list of "FAQ Item Name" (Which has multiple iterations of items each with different dates) where it shows the item with the soonest occurring month. This is so I can create a table that shows, for example, the next three reports that will be updated. I pull this into a "calPre" collection.


There is a slight problem in that "FAQ Item Name" is a lookup column, so it comes into a collection as a record that a table can't parse the text from, as well as having a number of blank records in that column that i need to filter out.


My solution to this is to pull that first collection (calPre) into a second collection (calPre2) that removes my blank rows and just gives me the two columns i'm interested it:


            FAQItem: Text('FAQ Item Name'.Value),
            dateMonth: Month



So now I have my two columns. You can see an instance above of the information that I might want to sort out: I would need to have a distinct list of the FAQItem column where the items that are returned are the ones with the soonest occurring date. My thinking is that I would create a new collection every time the app opens that would recalculate this, and I could sort it by the dateMonth column, then show the TopN number of results to get my 3 reports that will be updated soon. 


I've tried GroupBy, AddColumns, filtering by date, all the variations of Text() or Distinct().value/result and I either don't get anything returned, the dates are wrong, or it brings back lines and lines of [Object object] errors. 


I'm having real difficulty with something that I thought would be quite simple. Any help would be greatly appreciated!




I just found that the syntax you provided was ever so slightly off for what I needed (That's not in any blame by the way; you provided a fantastic solution for a problem that I didn't fully explain!). However, the explanations on the reading of the syntax and the functions were informative enough that I was able to go in and change my code really quite easily to pop out a perfect solution. 😄


If you're ever in Manchester, UK, I'm buying you a beer! 

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,181)