Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a Power BI matrix that looks something like this:
Typically how this may look in power bi is the "type" column is a row value from the data and the "quantity" is a count distinct of the ID in the table.
Our current table is actually made with measures as the rows rather than a grouping by columns. "Type 1" is one measure, "Type 2" is another, and so on.
When I hover over a measure in the matrix I need to be able to display data about that measure in a tooltip. To do this I would want to pass the measure name as a variable similar to the behavior of SELECTEDVALUE([type]) in the first option. Example:
SWITCH( [SELECTED MEASURE NAME]
, "Type 1", Calcuate()
, "Type 2", Calculate()
...
)
Are there any Dax commands that could accomplish this?
Solved! Go to Solution.
@jburton Hmm, I don't think so as SELECTEDMEASURE only works with Calculation Groups. Perhaps if you can share some sample data and your measure formulas there might be an alternative. For example, switch the matrix back to columns instead of values on rows. Create a disconnected table with your types in a single column, we'll call this table Table and the column Column. Then you could create a single measure like this:
Measure =
VAR __Type = MAX('Table'[Column])
VAR __Result =
SWITCH( __Type,
"Type 1", [Type 1],
"Type 2", [Type 2],
"Type 3", [Type 3],
"Type 4", [Type 4],
"Type 5", [Type 5],
"Type 6", [Type 6],
"Type 7", [Type 7]
)
RETURN
__Result
Now replace all of your other measures in your matrix with this measure. Now you have a column that you can easily use in a SWITCH statement to identify what to do.
@jburton Hmm, I don't think so as SELECTEDMEASURE only works with Calculation Groups. Perhaps if you can share some sample data and your measure formulas there might be an alternative. For example, switch the matrix back to columns instead of values on rows. Create a disconnected table with your types in a single column, we'll call this table Table and the column Column. Then you could create a single measure like this:
Measure =
VAR __Type = MAX('Table'[Column])
VAR __Result =
SWITCH( __Type,
"Type 1", [Type 1],
"Type 2", [Type 2],
"Type 3", [Type 3],
"Type 4", [Type 4],
"Type 5", [Type 5],
"Type 6", [Type 6],
"Type 7", [Type 7]
)
RETURN
__Result
Now replace all of your other measures in your matrix with this measure. Now you have a column that you can easily use in a SWITCH statement to identify what to do.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |