Forum Discussion
asparagus1_
4 months agoHelper I
Parameter table dimensions - summarize
Hi, I have a parameter table that lets users dynamically choose a dimension (e.g., product category, product family, etc.), which changes how the data is sliced in a visual. I’d like to calculate a...
- 4 months ago
Field parameters aren’t actual columns, so they can’t be used directly inside SUMMARIZE. They act more like a dynamic dimension selector. To work with the selected field, create a conditional measure that responds to the chosen parameter value.
Example:
VAR _order = SELECTEDVALUE ( FieldParameter[Order] ) RETURN SWITCH ( _order, 1, SUMX ( SUMMARIZECOLUMNS ( 'Table'[Column1], "@value", [The Measure] ), [@value] ), 2, SUMX ( SUMMARIZECOLUMNS ( 'Table'[Column2], "@value", [The Measure] ), [@value] ), 3, SUMX ( SUMMARIZECOLUMNS ( 'Table'[Column3], "@value", [The Measure] ), [@value] ) )
Thomaslleblanc
4 months agoSuper User
You cannot have a dynamic column in a measure using SUMMARIZECOLUMNS
You could use a more complicated method like a mapping table and the TREATAS function, but that is more complicated than a simplae measure