cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fernanda
Helper III
Helper III

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,478)