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 / Select distinct values...
Power Apps
Answered

Select distinct values based on Namn and Date column

(0) ShareShare
ReportReport
Posted on by 24

Hello community, 

I am pretty new at Power Apps, and I am trying to help a colleague with a formula. He has a form where people can register, but the thing is that they can register multiple times, but that could be "cheating".

 

So in the Power App, the ideal scenario would be to select only the Distinct names based on the Start Date data field.

This is our initial formula:

SortByColumns(Filter(Table1, DateValue(Matchdag) = DatePicker1.SelectedDate),"Namn",SortOrder.Ascending)
I have tried to distinct/unique the values "Namn", but couldn't do it.
 
Thanks in advance for any help 😄
Categories:
  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Is the whole record the same ? then you could just try this

    Distinct(Table, ThisRecord)

    This solution is only working if the two records are exactly the same

    you could create a collection and add a column as sort of identifier (name and date)

    ClearCollect(
     ColTest,
     AddColumns(
     Table(),
     Identifier,
     Concatenate(
     Column1,
     Column2
     )
     )
    )

    Then you could use RemoveIf()Countrows>1 or a distinct on only this Column. Be aware that using Distinct on one specific column will return a table with only this column.

  • VictorAMV Profile Picture
    24 on at

    Thanks for your reply 🙂

    So, the thing is that many users can enter there and register, so there would be many names, but they can enter many times, so then multiple records would be stored with the Start time column showing the date, that was my reasoning behind it.

    I tried the ClearCollect but gives me an error saying that I cannot change the form.

     

    I tried:

    ClearCollect(UniqueNames,
        Distinct(
            Filter(
                Table1,
                DateValue(Matchdag) = DatePicker1.SelectedDate
            ),
            "Namn"
        )
    And it says Behavior property is a non-behavior function. You can't use this property to change values elsewhere in the app.
  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Can you send a Screenshot of the Formula you used and the error message you are getting

  • VictorAMV Profile Picture
    24 on at

    I am also trying this one, but no luck so far:
    Distinct(
    Filter(
    Table1,
    DateValue(Matchdag) = DatePicker1.SelectedDate
    ),
    Namn)

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Could you try to clear Collect a collection with the filter and then use the distinct function?

    ClearCollect(colNamn,
     Filter( 
     Table1,
     DateValue(Matchdag) = DatePicker1.SelectedDate
     )
    );
    Distinct(colNamn,Namn)
  • VictorAMV Profile Picture
    24 on at

    gives the same error:

    VictorAMV_0-1713794149783.png

    I have tried Namn and "Namn" as I wasn't sure

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Yes, that's normal you need to put the clearcollect somewhere else than in the gallery/table. You can test by putting the ClearCollect function in a button onSelect and later put it in the DatePicker onChange property.

  • VictorAMV Profile Picture
    24 on at

    Can't seem to find the onChange property

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    No i mean controlls that are not the Gallery. A Gallery can not create a collection. only Buttons and controlls with an input can create a collection

  • VictorAMV Profile Picture
    24 on at

    Not sure I follow. So basically a button that has the two commands, and then shows the result in another part? Not in the gallery itself?

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

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard