Hi.
Managing the blanks in the gallery is pretty straightforward and here is an example. Just paste the code into the Items property of your gallery control and update the data source and dropdown control:
Filter(Sort(Split(Concat(Filter(yourDatabase,State=yourDropDownControl.Selected.Result),
If(!IsBlank('Car Color'),'Car Color' & ", ","") &
If(!IsBlank('House Color'),'House Color' &", ","") &
If(!IsBlank('Flowers'),'Flowers' &", ","") &
If(!IsBlank('Pets'),'Pets' &", ","")),", ")
,Result,Ascending),!IsBlank(Result))
Fetching the column names in Power App is a little more tricky but here's a way to do it:
Get Collection Column Names - Matthew Devaney
I hope this solves your challenge.