Forum Discussion
Create Matrix with Metric as a Column header
In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563
For you, create a table like:
Metric
MTD
MTD Vs Budget
YTD
YTD vs Budget
Then you would create a measure that refers to your other measures. So, something along the lines of:
Metric to Show =
VAR __metric = MAX('Table'[Metric])
RETURN
SWITCH(__metric,
"MTD",[MTD],
"MTD Vs Budget",[MTD Vs Budget],
"YTD",[YTD],
"YTD vs Budget",[YTD vs Budget],
BLANK()
)
This assumes that you have measures named [MTD], [MTD Vs Budget], etc. You would use the Metric column as a column in your matrix. So, the VAR gets the maximum value, which is to say the value in the column and then uses that to decide which of your 4 measures to display.
Hi Greg,
Thank you for your reply.
I'm not sure that this will solve my issue.
If you look at the image, I need to show the 4 metrics, for each client. This is not the issue.
What I'm unable to do, is to show the percentage on top of the client. This percentage is a metric, than should vary with the context of the slicers. This metric is variable. So I'm able to create the metric and use it a a Value of the matrix, but Im unable to use it as a column header in a matrix.
Regards,
GV