Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Filter gallery by dropdown and date range

(0) ShareShare
ReportReport
Posted on by 395

Hi, 

 

I have a gallery that iam trying to filter by a few drop downs, as well as by date range. The dropdown works fine, just having some troubles getting the date range to filter. Any advice would be much appreciated

 

Filter(EngineTimeSheet,
(Len(JNdrop.Selected.Value)= 0 ||
JobNumber = JNdrop.Selected.Value
) &&
(
Len(TYPEdrop.Selected.Value)=0 ||
TypeOfWork = TYPEdrop.Selected.Value
)&&
(
Len(USERdrop.Selected.Value)=0 ||
Name = USERdrop.Selected.Value

)

Spoiler (Highlight to read)

&&

Date( >=StartDate.SelectedDate && Date <=EndDate.SelectedDate

&&Date( >=StartDate.SelectedDate && Date <=EndDate.SelectedDate



)))

Categories:
  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Filter gallery by dropdown and date range

    Thanks Warren, the date name was just in a test environment, will be re-naming to something more suitable, cheers

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Filter gallery by dropdown and date range

    Hi @Matt383 ,

    Apart from Date being a very bad name for a field and you had a bracket in the wrong place in the bottom code, this is correct structure assuming your values are valid

    Filter(
     EngineTimeSheet,
     (
     Len(JNdrop.Selected.Value)= 0 ||
     JobNumber = JNdrop.Selected.Value
     ) &&
     (
     Len(TYPEdrop.Selected.Value) = 0 ||
     TypeOfWork = TYPEdrop.Selected.Value
     )&&
     (
     Len(USERdrop.Selected.Value) = 0 ||
     Name = USERdrop.Selected.Value
     ) &&
     Date >= StartDate.SelectedDate && 
     Date <= EndDate.SelectedDate
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard