Forum Discussion
Create a single filter to filter across two columns
- Anonymous5 years ago
HI Anonymous,
#1, Unpivot columns show be a better choice to handle multiple value field interactions, but it will expand your table records so it should not suitable to work with tables that include larger amount of records.
For this scenario, you can consider extracting the category field and value fields to a new table that only includes the key fields, then do unpivot on it. (it should better than direct expand raw tables records)
#2. According to your description, it seems like you are trying to create a dynamic field that based on filter selection. For this requirement, you need to create a parameter table that stored the value field names, then you can use it on the switch function to show different table field values based on current selections.
Measure = // parameter table stored A,B,C,D types of field name VAR selected = SELECTEDVALUE ( ParaTable[Field Name] ) RETURN SWITCH ( selected, "A", SUM ( Table[Field A] ), "B", SUM ( Table[Field B] ), "C", SUM ( Table[Field C] ), "D", SUM ( Table[Field D] ), //default and exception case SUM ( Table[Field A] ) )BTW, current power bi does not support creating a dynamic calculated column/table based on filter selections. Please use the measure formula instead.
Regards,Xiaoxin Sheng
HI Anonymous,
#1, Unpivot columns show be a better choice to handle multiple value field interactions, but it will expand your table records so it should not suitable to work with tables that include larger amount of records.
For this scenario, you can consider extracting the category field and value fields to a new table that only includes the key fields, then do unpivot on it. (it should better than direct expand raw tables records)
#2. According to your description, it seems like you are trying to create a dynamic field that based on filter selection. For this requirement, you need to create a parameter table that stored the value field names, then you can use it on the switch function to show different table field values based on current selections.
Measure =
// parameter table stored A,B,C,D types of field name
VAR selected =
SELECTEDVALUE ( ParaTable[Field Name] )
RETURN
SWITCH (
selected,
"A", SUM ( Table[Field A] ),
"B", SUM ( Table[Field B] ),
"C", SUM ( Table[Field C] ),
"D", SUM ( Table[Field D] ),
//default and exception case
SUM ( Table[Field A] )
)
BTW, current power bi does not support creating a dynamic calculated column/table based on filter selections. Please use the measure formula instead.
Regards,
Xiaoxin Sheng
Hello,
Thank you for getting back to me on this, I'm sorry I didn't sooner however I took a period of leave so didn't think about this! I will certainly give this a try, thank you. The only other option I found that worked was bookmarks.
Thanks,
E