Forum Discussion
Sum Columns with Field Parameters
- Anonymous4 years ago
Hi Alan_irt ,
Since A,B,C,D are column names not Values, we could not apply them to slicer to controll their visibilty. And Table visual could not realize your expected output. We need to use measures and Matrix visual instead.
Please firstly create a new table for slicer:
Then create measures:
Matched Value = IF(MAX('For Slicer'[Value])="A", SUM('Table'[A]),IF(MAX('For Slicer'[Value])="B", SUM('Table'[B]), IF(MAX('For Slicer'[Value])="C",SUM('Table'[C]),IF(MAX('For Slicer'[Value])="D",SUM('Table'[D])))))Result = var _t=SUMMARIZE('For Slicer',[Value],"sum",[Matched Value]) return SUMX(_t,[sum])Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Alan_irt ,
Since A,B,C,D are column names not Values, we could not apply them to slicer to controll their visibilty. And Table visual could not realize your expected output. We need to use measures and Matrix visual instead.
Please firstly create a new table for slicer:
Then create measures:
Matched Value =
IF(MAX('For Slicer'[Value])="A", SUM('Table'[A]),IF(MAX('For Slicer'[Value])="B", SUM('Table'[B]), IF(MAX('For Slicer'[Value])="C",SUM('Table'[C]),IF(MAX('For Slicer'[Value])="D",SUM('Table'[D])))))Result =
var _t=SUMMARIZE('For Slicer',[Value],"sum",[Matched Value])
return SUMX(_t,[sum])
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Evelyn, I'll give this a go. I was planning on using the new Field Parameter slicer option to filter by the column names. This appears to work well within the table to control which columns are shown.