Forum Discussion
Dynamic Multi-Column Filter based on one parameter
Hi osindhuw1 ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
var _table=
{"departed","arrived"}
var _table2=
DISTINCT('Table'[Year departed])
return
CROSSJOIN(
_table,_table2)
2. Create measure.
Flag =
var _selectvalue=SELECTEDVALUE('Table 2'[Value])
var _selectyear=SELECTEDVALUE('Table 2'[Year departed])
return
SWITCH(
TRUE(),
_selectvalue = "arrived"&&MAX('Table'[Year arrived])=_selectyear&&MAX('Table'[Arrival OK])=1,1,
_selectvalue = "departed"&&MAX('Table'[Year departed])=_selectyear&&MAX('Table'[Departure OK])=1,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- osindhuw13 years agoNew Member
Hi Anonymous ,
First of all thank you very much for your prompt reply. I have check your model and it seems good.
But the problem now is, the flag is somehow cannot be connected with other visual chart, which using parameter (for separator) instead of the created table value. Both table and visual need to be filtered with the same flag, which same rule, 2023 year and data OK (departed or arrived one, depend on selection).
I attach the files so you can relate (somehow i cannot attach the pbix), please advise?