How can I use a slicer to dynamically select a column from my table? I want to have two slicers: the first to select the function and the second to select the column. I can get the first slicer working, but having issues with the second.
I’ve tried
FinalValue =
VAR Func = SELECTEDVALUE(StatFunctionSelector[Function])
VAR Col = SELECTEDVALUE(FieldParameter[Parameter])
RETURN SWITCH(Func,
"Average", AVERAGE(Table1[Col]),
"Max", MAX(Table1[Col]),
"Min", MIN(Table1[Col]),
"Sum", SUM(Table1[Col]),
"Count", COUNT(Table1[Col]),
"StdDev", STDEV.P(Table1[Col]))
I’d rather avoid having to spell each permutation out explicitly.
For example, if I have columns
A,B,C,D,E,F,G
I’d like to have to a slider that lets you select which function to apply (average, min, max, etc.) and then another slicer that selects which column to use.
For example, if selected “Average” and “A”, I’d get the average of column A.