cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LuccaGiffoni
Helper I
Helper I

Filter gallery by how long the item has been there

Hello everybody!

 

I'm trying to put another filter on my gallery (based on a SharePoint list) to only display items that have been there for less than 6 months, but I don't know how to do that filter. Can someone help me?

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @LuccaGiffoni ,

Try

Filter(
   YourListName,
   DateDiff(
      Created,
      Today(),
      Months
   ) <=6
)

 

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.

 

View solution in original post

@LuccaGiffoni ,

As below - please note you can accept solutions to different questions

Filter(
   'Users Data', 
   (
      UserVerifyGallery_ddUserName.Selected.Result = "All" || 
      Nome = UserVerifyGallery_ddUserName.Selected.Result
   ) &&
   (
      UserVerifyGallery_ddSituacao.Selected.Result = "-" ||
      'Situação?' = UserVerifyGallery_ddSituacao.Selected.Result
   )
)

 

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.

View solution in original post

8 REPLIES 8
WarrenBelz
Super User III
Super User III

Hi @LuccaGiffoni ,

Try

Filter(
   YourListName,
   DateDiff(
      Created,
      Today(),
      Months
   ) <=6
)

 

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.

 

View solution in original post

LuccaGiffoni
Helper I
Helper I

@WarrenBelz  Hi! It's me again kkk

I'm probably doing something wrong, because it's not working with my conditional.

 

Could you help me again?

@LuccaGiffoni ,

You need the Filter at the front of that - if you post your code as Text I can clean it up for you. Note due to time zone I will be offline very shortly.

LuccaGiffoni
Helper I
Helper I

@WarrenBelz Nice!

If(   
   Filter('Users Data', DateDiff(Created, Today(), Months) <= 6,
   ddAdminUserNome.Selected.Result = "All", 'Users Data', Filter('Users Data', Nome = ddAdminUserNome.Selected.Result))

@LuccaGiffoni 

Try

Filter(
   'Users Data', 
   DateDiff(Created, Today(), Months) <= 6 &&
   (ddAdminUserNome.Selected.Result = "All" || Nome = ddAdminUserNome.Selected.Result)
)

 

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.

LuccaGiffoni
Helper I
Helper I

@WarrenBelz Thanks!

It worked perfectly!

 

LuccaGiffoni
Helper I
Helper I

@WarrenBelz 

Just another one, I promisse kkkkk

 

How could I make it works on this Gallery with all this conditionals and filters?

If( 
    // Para situações e nomes quaisquer
    UserVerifyGallery_ddUserName.Selected.Result = "All" && UserVerifyGallery_ddSituacao.Selected.Result = "-", 'Users Data',

    // Para todos os nomes e uma situação específica
    UserVerifyGallery_ddUserName.Selected.Result = "All" && UserVerifyGallery_ddSituacao.Selected.Result <> "-", Filter('Users Data', 'Situação?' = UserVerifyGallery_ddSituacao.Selected.Result),

    // Para todas as situações e um nome específico
    UserVerifyGallery_ddUserName.Selected.Result <> "All" && UserVerifyGallery_ddSituacao.Selected.Result = "-", Filter('Users Data', Nome = UserVerifyGallery_ddUserName.Selected.Result),

    // Para situações e nomes específicos (Default)
    UserVerifyGallery_ddUserName.Selected.Result <> "All" && UserVerifyGallery_ddSituacao.Selected.Result <> "-",
    Filter('Users Data', Nome = UserVerifyGallery_ddUserName.Selected.Result && 'Situação?' = UserVerifyGallery_ddSituacao.Selected.Result))

@LuccaGiffoni ,

As below - please note you can accept solutions to different questions

Filter(
   'Users Data', 
   (
      UserVerifyGallery_ddUserName.Selected.Result = "All" || 
      Nome = UserVerifyGallery_ddUserName.Selected.Result
   ) &&
   (
      UserVerifyGallery_ddSituacao.Selected.Result = "-" ||
      'Situação?' = UserVerifyGallery_ddSituacao.Selected.Result
   )
)

 

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.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (4,181)