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.