Forum Discussion
matrix show columns based on slicer selection
- Anonymous2 years ago
Hi whichOne
Based on your needs, I have created the following table.
Then you can create a measure by using the following dax:Dynamic = SWITCH(TRUE(), SELECTEDVALUE('Parameter (2)'[Parameter]) = 1,CALCULATE(SELECTEDVALUE('Table'[VALUE]),FILTER('Table','Table'[Column1] = 1 || 'Table'[Column1] = 2)), SELECTEDVALUE('Parameter (2)'[Parameter]) = 2,CALCULATE(SELECTEDVALUE('Table'[VALUE]),FILTER('Table','Table'[Column1] = 3 || 'Table'[Column1] = 4)), SELECTEDVALUE('Table'[VALUE]) )
Put the corresponding fields into the table so that you can make the table display specific columns based on the slicer selection.Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
whichOne Use an Enter Data query and enter data like:
Column1
Measure1
Measure2
Measure3
Measure4
Don't connect it to anything (no relationships). Use this in your Columns field well in your matrix and in your slicer. Then use a single measure along the lines of:
Selected Measure =
VAR __Measure = MAX('Disconnected Table'[Column1])
VAR __Result =
SWITCH( __Measure,
"Measure1", [Measure1],
"Measure2", [Measure2],
"Measure3", [Measure2],
"Measure4
)
RETURN
__ResultAh ok I see what you mean. The column names might be confusing, they are not actually measures, they are just my table column attributions, I am calling them "measure". Should I make all the columns in the table measure first? I dont think I can just use columns directly like you purposed.