How do I create a filter in Power Apps that disables other filters

Viewed 14

I am trying to create 3 filters in Power Apps that I want to work uniquely (when one is selected the other 2 are automatically set to false)

I have created 3 buttons with the following code -

Button 1 - UpdateContext({FilterbyAA:!FilterbyAA})
Button 2 - UpdateContext({FilterbyBB:!FilterbyBB})
Button 3 - UpdateContext({FilterbyCC:!FilterbyCC})

My Gallery then has the code

If(FilterbyAA=true; Filter(EVENTDETAILS;TYPE="Once Off";PILLAR.Value="AA"); 
If(FilterbyBB=true;Filter(EVENTDETAILS;TYPE="Once Off";PILLAR.Value="BB");
If(FilterbyCC=true;Filter(EVENTDETAILS;TYPE="Once Off";PILLAR.Value="CC");Filter(EVENTDETAILS;TYPE="Once Off"))))

I am trying to change it to set the other filters to false when one is selected but the following code doesn't work. Can someone please assist with the correct syntax.

If(FilterbyAA=true; Filter(EVENTDETAILS;TYPE="Once Off";PILLAR.Value="AA") AND FilterbyBB=false AND FilterbyCC=false; 
If(FilterbyBB=true;Filter(EVENTDETAILS;TYPE="Once Off";PILLAR.Value="BB") AND FilterbyAA=false AND FilterbyCC=false;
If(FilterbyCC=true;Filter(EVENTDETAILS;TYPE="Once Off";PILLAR.Value="CC") AND FilterbyBB=false AND FilterbyAA=false ;Filter(EVENTDETAILS;TYPE="Once Off"))))
0 Answers
Related