Forum Discussion
Field Parameters - Individual Filters
Hi all!!
I have been using the field parameters feature (successfully I think) and now have a different issue that I'm wondering if it can be done. I will explain a simplified version of what I have:
Consider a table of 5 customers A-E (Col 1). There are then 3 extra columns (Flag1, Flag2, and Flag3) that are flags giving a 'Y' or a 'N'.
| Customer | Flag1 | Flag2 | Flag3 |
| A | Y | Y | N |
| B | Y | N | N |
| C | Y | N | N |
| D | N | N | Y |
| E | N | Y | Y |
My fields parameter slicer works in that if I select Flag1 only, the Flag1 column and the Customer column are shown:
| Customer | Flag1 |
| A | Y |
| B | Y |
| C | Y |
| D | N |
| E | N |
How can I make it so that depending on the column selected only rows where 'Y' is present are shown. I have tried putting an individual filter on Flag1 to show only when value contains 'Y' which works:
| Customer | Flag1 |
| A | Y |
| B | Y |
| C | Y |
HOWEVER, if I select Flag2 the same rows are displayed, in which case I see:
| Customer | Flag2 |
| A | Y |
| B | N |
| C | N |
where I would want to see:
| Customer | Flag2 |
| A | Y |
| E | Y |
I know this is a new feature but does anyone have a solution? Many thanks in advance!!!
Hi, Thom_ ;
Sorry for the late recovery.
You could change it.
filter2 = SWITCH(MAX(Parameter2[Parameter2]),"Fl1", IF( [Fl1]="Y",1),"Fl2", IF( [Fl2]="Y",1),"Fl3", IF([Fl3]="Y",1))The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- v-yalanwu-msftCommunity Support
Hi, Thom_ ;
Try to create a filter measure.
filter = SWITCH(MAX('Parameter'[Parameter]), "Flag1", IF( MAX('Table'[Flag1])="Y",1), "Flag2", IF( MAX('Table'[Flag2])="Y",1), "Flag3", IF( MAX('Table'[Flag3])="Y",1))Then apply it into filter.
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Thom_Frequent Visitor
Hi v-yalanwu-msft ,
Thank you so much for this! 😁
However, when I recreate this on my end I get an error saying Column 'xx' in table 'xxx' cannot be found or may not be used in this expression. I believe this is due to my Flag1, Flag2 and Flag3 columns being measures and not raw data for which it works in your example. I have recreated this and added it in the pbix you so kindly made. Is there a different but logically similar way to account for the fact my columns are measures?
Link for the pbix file:
https://www.dropbox.com/s/i7oedab5tsk0qnr/Field%20Parameters.pbix?dl=0
- v-yalanwu-msftCommunity Support
Hi, Thom_ ;
Sorry for the late recovery.
You could change it.
filter2 = SWITCH(MAX(Parameter2[Parameter2]),"Fl1", IF( [Fl1]="Y",1),"Fl2", IF( [Fl2]="Y",1),"Fl3", IF([Fl3]="Y",1))The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Thom_Frequent Visitor
- amitchandakSuper User
Thom_ , Assume name of field parameter is axis slicer
use this meausre in visual or visual level filter
var _sel = maxx(filter('Axis Slicer', 'Axis Slicer'[Axis Slicer Order]= SELECTEDVALUE('Axis Slicer'[Axis Slicer Order])),'Axis Slicer'[Axis Slicer])
var _filter = Switch(True() ,
"Flag 1" , filter(Table, Table[Flag 1] = "Y"),
"Flag 2" , filter(Table, Table[Flag 2] = "Y"),
"Flag 3" , filter(Table, Table[Flag 3] = "Y")
)
return
calculate(countows(Table), _filter)refer if needed
- Thom_Frequent Visitor
Hi Amit,
Many thanks for this!!
I try this measure however I get an error saying:
Also the VAR _sel isn't referenced any further.