cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALZamora
Level: Powered On

Adding IF formula to a gallery filter

I have a gallery that shows records according to what student is selected (combo box) and then what audit (radio). Upon opening this screen, the radio control is reset to no selection, thus no records show. How can I have all the records for the selected student shown upon opening the screen, then filtered once you select the radio button? 

 

Here's my current formula which does not show any records in the gallery until you select an option on the radio control:

 

Filter(SortByColumns(Filter(Table_Audits, Student = cbo_AIstudent.Selected.Student),"AuditDate",Descending),Audit=radio_audittypeREC.Selected.Value)

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Adding IF formula to a gallery filter

@ALZamora 

You might try this formula for your Gallery Items property:

 

SortByColumns(
Filter(Table_Audits,
Student=cbo_Alstudent.Selected.Student) &&
If(!IsBlank(radio_audittypeREC.Selected.Value), Audit=radio_audittypeREC.Selected.Value, true)),
"AuditDate", Descending)

This will give you what you are looking for.

 

I hope that is helpful.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Adding IF formula to a gallery filter

@ALZamora 

You might try this formula for your Gallery Items property:

 

SortByColumns(
Filter(Table_Audits,
Student=cbo_Alstudent.Selected.Student) &&
If(!IsBlank(radio_audittypeREC.Selected.Value), Audit=radio_audittypeREC.Selected.Value, true)),
"AuditDate", Descending)

This will give you what you are looking for.

 

I hope that is helpful.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

ALZamora
Level: Powered On

Re: Adding IF formula to a gallery filter

@RandyHayes  Thank you for the help! I had to move a couple of the parantheses to make it work, but then it worked beautifully! 

Super User
Super User

Re: Adding IF formula to a gallery filter

@ALZamora 

Sorry about the parenthesis...I was typing that in on-the-fly.

Should have been:

 

SortByColumns(
   Filter(Table_Audits, 
       Student=cbo_Alstudent.Selected.Student && 
       If(!IsBlank(radio_audittypeREC.Selected.Value), Audit=radio_audittypeREC.Selected.Value, true)), 
"AuditDate", Descending)

Glad you got it working.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
ALZamora
Level: Powered On

Re: Adding IF formula to a gallery filter

@RandyHayes 

 

Totally ok! Without you, I wouldn't have gotten any where near the formula I needed. Smiley Wink

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,672)