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 / Need to display "...
Power Apps
Answered

Need to display "Distinct" values in a drop box but still access other fields in the selected row.

(0) ShareShare
ReportReport
Posted on by 79

Is there no way to select a distinct row as opposed to a single column table when using the Distinct function?  I must be missing something.

 

I have a dropdown box that needs to populate with all patients last names on a schedule for a given day.  They have multiple appointments on a given day so the dropdown box populated by this code:

 

SortByColumns(Filter('[dbo].[vAppointments]', FLDDATEINT = Value(Text(_dateSelected,"[$-en-US]yyyymmdd"))),"FLDLNAME",Ascending)

 

...lists the patients last name multiple times but once selected allows me access the fields of the selected record from other controls via dropdown_lastname.selected.SomeOtherField.

 

If I change the above code using the Distinct statement it populates the dropdown box correctly but creates a one column table "result" that does not allow me to use as a pointer to the other fields on the selected row.   Please help. Thanks.

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    Hi @nhale ,

    The following (you will need to put in your Distinct field name) will put all the other fields in a table called Fields, so for instance if you wanted the Patient field, the reference would be Fields.Patient. 

    SortByColumns(
     AddColumns(
     Distinct(
     Filter(
     '[dbo].[vAppointments]',
     FLDDATEINT =
     Value(
     Text(
     _dateSelected,
     "[$-en-US]yyyymmdd"
     )
     ),
     YourDistinctFieldName
     ),
     "Fields",
     LookUp(
     '[dbo].[vAppointments]',
     Result = YourDistinctFieldName
     )
     ),
     "Result",
     Ascending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at

    Hi @nhale ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • nhale Profile Picture
    79 on at

    Thanks this works.  It's a little slow loading so I may to refine further but appreciate the help.  

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard