Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
20 | |
14 | |
10 | |
9 | |
6 |