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 / Distinct in If formula...
Power Apps
Answered

Distinct in If formula for gallery

(0) ShareShare
ReportReport
Posted on by 21

Hi, 

I have a gallery with report records on it but currently it is show up as multiple records. How do I show only distinct records?

 

Below is my formula: It looks at the input search text box for any data, if no data, show everything
If(IsBlank(SearchBox.Text),

SortByColumns('app.database',"cdr_date",SortOrder.Descending),

SortByColumns(Search('app.database',SearchBox.Text,"crew","cdr_ref","service_order","location"),"cdr_date",SortOrder.Descending)).

Secondly, I have another gallery which pulls in the report LxWxD data. How can i filter that gallery so when I select the distinct report in the first one, it will show all the rows of LxWxD data (for example if it has three rows of record for that)

 

Thanks!

 

Categories:
I have the same question (0)
  • JayMagness Profile Picture
    1,663 on at

    HI,

    If your formula above works to get the data, then you can do the following:

     

    Distinct( "Your formula" ),"The field to list")

     

    Distinct function in Power Apps - Power Platform | Microsoft Learn

     

  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @weebot ,

     

    In fact, you do not need if and isBlank to judge the SearchBox, and the first gallery can also be sorted by your given criteria. You can make some adjustments to Search statement by setting Items in the first gallery:

    Distinct(SortByColumns(
     Search(
     'app.database',
     SearchBox.Text,
     "crew",
     "cdr_ref",
     "service_order",
     "location"
     ),
     "cdr_date",
     SortOrder.Descending
    ),LxWxD)

     

    Then set the Items of the second gallery to:

    Filter('app.database',LxWxD=Gallery3.Selected.Value)

     

    Note: The name of our data source may be different, please use your data source name.

     

    Best regards,

    Rimmon Li

     

  • weebot Profile Picture
    21 on at

    Thanks all! Now I realized the distinct only bring in the one value - for example cdr_ref. Is there a way to bring in more such as crew, cdr_ref, service_order, location?

     

  • JayMagness Profile Picture
    1,663 on at

    Hi,

    Yes there is the process I follow is to add lookups for the fields you want

  • JayMagness Profile Picture
    1,663 on at

    Please do not forget to close this and give the solution.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard