cancel
Showing results for
Did you mean:
Frequent Visitor

## Calculate relative position of list item

I have a list with three columns, name, group and seniority number.

Seniority number is a company assigned 4 digit number, they will not be sequential within a group.

I am trying to calculate someones relative seniority within a given group, or the whole group.

Eg: Whole list has 150 items, when the list is ordered by seniority number, you appear as list item 6, you therefore have a seniority of 6/150, or 4%. Or, filter list to Group A, of which there are 50 items, ordered by seniority number, you appear as list item 10, you therefore have a seniority of 20%.

This is possible in excel using MATCH, but this function has another use in PowerApps. Any ideas how I can achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Just one of likely many many ways but

TMROSTER is my SPList

My Gallery Items is

``````ForAll(
Sequence(CountRows(TMROSTER)), {Sequence:Value})``````

In my gallery I can then set one of the controls to show sequence number (this will be their place in the list) and then another control to display something liek this

``Last(FirstN(Sort(TMROSTER,Title,Ascending),ThisItem.Sequence)).Title``

Mine in example is sorted by column (their name) in yours you would sort by the seniority value smallest to largest (or whichever direction gives you result you want) This will display each person in order without doing a collect first. and you can reference countrows(splist) and the thisitem.sequence for your maths

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
Super User

Just one of likely many many ways but

TMROSTER is my SPList

My Gallery Items is

``````ForAll(
Sequence(CountRows(TMROSTER)), {Sequence:Value})``````

In my gallery I can then set one of the controls to show sequence number (this will be their place in the list) and then another control to display something liek this

``Last(FirstN(Sort(TMROSTER,Title,Ascending),ThisItem.Sequence)).Title``

Mine in example is sorted by column (their name) in yours you would sort by the seniority value smallest to largest (or whichever direction gives you result you want) This will display each person in order without doing a collect first. and you can reference countrows(splist) and the thisitem.sequence for your maths

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Announcements

#### Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

#### April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA