web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Ranking value based on...
Power Apps
Unanswered

Ranking value based on dropdown selection and data table positions

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey guys,

 

I am trying to get the ranking value based on a dropdown selection and data table 'People Cost (USD)' numeric column, I am currently using a gallery to filter the user's selection in which I added a text label to retrieve the ranking number; but I do not know which function would be suitable for this problem.

 

This is how the app looks like:

ajmbarron_0-1594050862460.png

 

Desired output:

 

ajmbarron_3-1594051216609.png

 

Thanks in advance.

 

 

Categories:
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    I am giving the below formula based on the information you provided (I see most of the text is morphed)

    try this:

    Filter(datasource,Value('People Cost (USD)') = Value(dropdownLevel.Selected.Value))

     
    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey @KrishnaV ,

    Here is a glance of how database looks like:

    CountryLevelPeople Cost (USD)Exchange Rate
    United StatesM19001
    United StatesM21001
    United StatesM32701
    United StatesM48991
    ArgentinaM178940
    ArgentinaM287040
    ArgentinaM312340
    ArgentinaM469940
    MexicoM167725
    MexicoM299925
    MexicoM3100025
    MexicoM4120025
    ChileM149912
    ChileM220012
    ChileM3100012
    ChileM4487012

     

    As you can see "Level" column stands for position level code (junior, senior, super senior, etc), NOT for a Level Ranking (1st, 2nd, 3rd,..., nth).

     

    Note: The present data is simulated data , used to represent this issue and in no way represents real data from any official source. 

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you describe more clearly about the data that you want to display in the label?

    Actually, I do  not fully understand your app's logic.

    Could you tell me:

    Which control is used to filter data? which control is used to display filtered data? What does the ranking value represent that display in the label? The gallery's Items? What is your data source?

     

    I assume that:

    Your data source is sharepoint list.
    The gallery is to display all the data of the data source. The drop downs for level and country are used to filter People Cost (USD).

    The label is used to display the ranking value of the filtered item.

    If so, you could set the label's Text like this:

    CountRows(
    Filter(listname,
    'People Cost (USD)'<=
     LookUp(listname,
     Country=countrydropdown.Selected.Value,
     Level=leveldropdown.Selected.Value,
     'People Cost (USD)'
     )
     )
    )

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey @v-yutliu-msft ,

     

    Which control is used to filter data?

    A: I inserted a gallery item in which I wrote this code on the "Items" Selection:

     

    Filter(tr_table, Pais= 'country.dropdown'.Selected.Result && LG= 'level.dropdown'.Selected.Result)

    (This gallery is located at the left bottom of the app; where the ranking field would be displayed) 

     

    which control is used to display filtered data?

    A: I use a data table and I wrote this code on the Items Selection

     SortByColumns(
     Filter(
     tr_table,
     LG = 'level.dropdown'.Selected.Result && 'Costo USD'> 0
     ),
     "Costo_x0020_USD",
     "Descending")

     

    What does the ranking value represent that display in the label?

    A: Ranking value represents the value position of 'People Cost (USD)' on the inserted data table (1st place, 2nd place, 3rdplace, nthplace) by user dropdown menu selection for Country and Level.  

     

    The gallery's Items?

    A: There are no items in the gallery I just wrote this code in order to filter the desired ranking by user selection:

    Filter(tr_table, Pais= 'country.dropdown'.Selected.Result && LG= 'level.dropdown'.Selected.Result)

    What is your data source?

    A: It's a sharepoint list with less than 500 records.

     

    I am getting this Issue when I use the proposed code:

    "Delegetion warning. The "Filter" part of this formula might not work correctly 

    on large data sets. The data source might not be able to process the formula and might return an incomplete data set. Your application might not return correct results or behave correctly if the data set is incomplete) "

    Location: Label1.Text

     

    Any clues would be appreciated, 

    Thanks for your help,

     

    Regards

     

     

     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you mean that:
    1)the data table's Items is filtered based on selected level

    2)you want to filter based on level and country to check the ranking of 'People Cost (USD) in that data table?

    If so, try to set the label's Text to display ranking :

    CountRows(
    Filter(listname,
    LG = 'level.dropdown'.Selected.Result,
    "Costo_x0020_USD"<=
     LookUp(tr_table,
     LG = 'level.dropdown'.Selected.Result,
     Pais= 'country.dropdown'.Selected.Result,
     "Costo_x0020_USD"
     )
     )
    )

     

    No need to worry about delegation.

    Since your data source has less then 500 records, the delegation warning will not affect your app's performance.

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey @v-yutliu-msft ,

    First of all, thanks for your reply;

     

    1)the data table's Items is filtered based on selected level

    A: Yes, column items on the data table are based on selected level

     

    2)you want to filter based on level and country to check the ranking of 'People Cost (USD) in that data table?

    A: Yes, and show the ranking value based on that selection. 

     

    I use a data table not a list, however if I could convert to a list the data table column in the above formula would be great , as the above formula gives me the next error: "Issue: invalid argument type"

     

    Regards

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you tell me what is your data source?

    "listname" is just the data source that I used as example.

    Data table is not a data source, it is just acontrol.

    You need to replace listname with your data source name in my above formula.

     

     

    Best regards,

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard