Forum Discussion
Dynamic Column Names for Matrix Visual using Sliced Measures
- 7 years ago
Hi gghlyon
I've got an option that hopefully won't need much rework in your report
Create a mapping table which has the combinations of headers you want for the selection of your comparison in the slicer
Then in your matrix put TableHeaders in the Columns.
Finally, you'll need to create a "master" measure for use in the Values section of the matrix visual. This measure makes use of the SWITCH function to show the relevant values for the column header. You're essentially mapping your desired column header names to your existing Measures in this formula
MatrixValues = SWITCH(MAX(Mappings[TableHeaders]), "Actual",[Actuals], "Budget",[Budgets], "Forecast",[Forecasts], "Var Act vs Fcst",[Actuals] - [Forecasts], "Var Act vs Bud",[Actuals] - [Budgets])I've attached a prototype as a .pbix here. Inspiration from Matt Allington's excellent article on using SWITCH in a matrix
Hope that helps, let me know how it goes for you
Cheers,
Matt
Hi gghlyon
I've got an option that hopefully won't need much rework in your report
Create a mapping table which has the combinations of headers you want for the selection of your comparison in the slicer
Then in your matrix put TableHeaders in the Columns.
Finally, you'll need to create a "master" measure for use in the Values section of the matrix visual. This measure makes use of the SWITCH function to show the relevant values for the column header. You're essentially mapping your desired column header names to your existing Measures in this formula
MatrixValues = SWITCH(MAX(Mappings[TableHeaders]),
"Actual",[Actuals],
"Budget",[Budgets],
"Forecast",[Forecasts],
"Var Act vs Fcst",[Actuals] - [Forecasts],
"Var Act vs Bud",[Actuals] - [Budgets])I've attached a prototype as a .pbix here. Inspiration from Matt Allington's excellent article on using SWITCH in a matrix
Hope that helps, let me know how it goes for you
Cheers,
Matt
- Anonymous6 years agoNot applicable
This is great info thank you, but how can i format the columns individually to make this work. Example, if i have a percentage column i would like to format that as %.
Thank you for your help