Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello, all. I'm building a dashboard with a matrix, and I've created a measure to dynamically select the set of column in the matrix.
Activity Columns = {
("Tenure Group", NAMEOF('Activities'[actTenureGroup]), 0),
("Generation", NAMEOF('Activities'[actGeneration]), 1),
("Race", NAMEOF('Employee'[RaceEthnicityDescription]), 2)
}
I attached this measure to a slicer - when I make a selection in the slicer, the correct group of columns appears in the matrix, along with the appropriate counts in the cells of the matrix.
Next, I want to set the title of the matrix dynamically based on the selection in that slicer. I initially just selected the same measure in the Dynamic Title Formula dialogue, and that works - the value that I selected in the slicer shows as the title.
This isn't exactly what I'm looking for, though - I want to append the words "Activity By" to the beginning - "Activity By Generation", "Activity By Tenure Group", etc. Here's where I'm running into issues. I created the following measure:
Matrix Title = "Activity By "&SELECTEDVALUE('Activity Columns'[Activity Columns])
When I try to apply this measure in the Dynamic Title dialogue, though, it kicks an error:
It seems that when I use the Activity Columns measure itself as the dynamic title, Power BI recognizes the single selected value and sets the title correctly, but when I put that measure in another measure, it's trying to send the collection of column headers, which the Dynamic Title formula can't deal with.
Does anyone have any suggestions for how I can make this work?
Solved! Go to Solution.
For anyone who finds this looking for a solution, I found the answer. I needed to create this measure:
Selected Attribute =
VAR _Selectedvalue = SELECTCOLUMNS (
SUMMARIZE ( 'Activity Columns', 'Activity Columns'[Activity Columns], 'Activity Columns'[Activity Columns Fields]), 'Activity Columns'[Activity Columns]
)
RETURN _Selectedvalue
And then this measure:
Dynamic Title = "Activities By " & [Selected Attribute]
Then I selected the second measure in the Dynamic Title dialogue - the title now shows up as desired.
The issue was not data-dependent - this solution should work regardless of your data set. I just had to replace the column names with mine.
For anyone who finds this looking for a solution, I found the answer. I needed to create this measure:
Selected Attribute =
VAR _Selectedvalue = SELECTCOLUMNS (
SUMMARIZE ( 'Activity Columns', 'Activity Columns'[Activity Columns], 'Activity Columns'[Activity Columns Fields]), 'Activity Columns'[Activity Columns]
)
RETURN _Selectedvalue
And then this measure:
Dynamic Title = "Activities By " & [Selected Attribute]
Then I selected the second measure in the Dynamic Title dialogue - the title now shows up as desired.
The issue was not data-dependent - this solution should work regardless of your data set. I just had to replace the column names with mine.
Please share the dummy data file.
Sorry, I don't have a dummy data file. I don't think this error is specific to my data, though - I reproduced this exact sequence of events in another report with unrelated data.
I initially just selected the same measure in the Dynamic Title Formula dialogue,
Keep doing that . Change your measure to return "Activity by " and the original result oncatenated
That's my question - how? The Dynamic Title dialogue only allows the selection of a field - there's no way to build a formula in which to contatenate anything.
This is what I was trying to get around when I created the new measure to do the concatenation, and select that in the dialogue above, but that's where I run into the error.
You need to feed that title from a measure, not a column
Ok - do I take the measure that I showed above, then put that into another measure? Or maybe I've misworded my question in some way.
What other columns are part of the composite key?
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Just in case it matters, though, it doesn't appear that this is a data issue. I was able to reproduce the issue in a completely unrelated data set.
I cannot assist you if you are unable to provide sample data.
Got it - so this isn't a place to come for questions of functionality? Do you know of any other forums that might be able to answer those sorts of questions?
I would think that Stackoverflow is also rather geared towards finding solutions. For general discussions maybe try Reddit ?
Ok, got it. This is a huge HR data model that I'm working with, so I won't be able to post that. Thanks for your replies, though! I'll keep digging.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
107 | |
101 | |
92 | |
69 |
User | Count |
---|---|
172 | |
135 | |
132 | |
101 | |
95 |