cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fernanda
Resolver I
Resolver I

Multi Filter problem

Hello all!

 

I have a very simple app, where I have 2 filters which I need to work independently and also must show all records from the database in case nothing is selected.

 

But... I have no idea what I am doing wrong at this point. I have been trying every solution I can find, but now I am just messing it up rather than fixing it.

 

Here is some info from my app:

 

Filter1: Radio box: Choices(database.colnamedEmpresa)

Filter2: Combobox (single, not multiple choice): Distinct(database.colnamedAdmContrato; AdmContrato.displayname) this is a person/group type of column.

 

My gallery is filtered like this:

 

If(
!IsBlank(Radio3.Selected.Value)||!IsBlank(ComboBox1.Selected.Result)||IsEmpty(Radio3.Selected.Value)||IsEmpty(ComboBox1.Selected.Result)||IsEmpty(Radio3.Selected.Value);
Filter(database; Empresa.Value = Radio3.Selected.Value;ComboBox1.Selected.Result = 'Adm Contrato'.DisplayName); database)

 

Like I said, if my filters are cleared, it shows me all of the records from the database, but my filters are not working independently.

 

Due to the language set in my office and country, "," are ";"... it is very annoying and very confusing, specially when I am trying to copy someone's formula.

 

Please help me... I swear I can't see anymore where I am failing here

Thank you

Fernanda

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Fernanda 

Please consider changing your Formula to the following:

Filter(database; 
    (IsBlank(Radio3.Selected.Value) || Empresa.Value = Radio3.Selected.Value) &&
    (IsBlank(ComboBox1.Selected.Result) || 'Adm Contrato'.DisplayName = ComboBox1.Selected.Result)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Fernanda 

Please consider changing your Formula to the following:

Filter(database; 
    (IsBlank(Radio3.Selected.Value) || Empresa.Value = Radio3.Selected.Value) &&
    (IsBlank(ComboBox1.Selected.Result) || 'Adm Contrato'.DisplayName = ComboBox1.Selected.Result)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

OMG!!!! thank you!!!! it totally fixed it!!

Randy

 

Could I ask you something else regarding this very same solution??

 

I have another app where I implemented the very same solution and it worked perfectly, it has 3 filters lined up like the following

 

Filter('Prueba Informe Seg v2';
(IsBlank(cbusuario.Selected.Result) || Usuario.DisplayName = cbusuario.Selected.Result) &&
(IsBlank(cbgerencia.Selected.Result) || Gerencia.Department = cbgerencia.Selected.Result)&&
(IsBlank(ddempresa.Selected.Value) || Empresa.Value = ddempresa.Selected.Value))

 

But when I try to add a search box, I can't make it work. I have seen search function inside of filter, if function, filter inside of search, but i can't

 

My search function alone (it works perfectly and it search in 2 columns) is: Search('Prueba Informe Seg v2';pruebabusqueda.text;Title;pedido)

 

Could you please help me??

thank you in advance!

Fernanda

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,657)