Forum Discussion
Dynamic Text for a Drill Through
Hello gmsamborn ,
I apologize if I wasn't clear. I am still very new to Power BI and Dax.
Color Parameter is just that, a parameter. ( a 'fields' parameter if that helps)
My use case:
I have one page with a stacked bar graph that changes the legend colors based on the Color Parameter selection (Gender, Race/Ethnicity or Residency, etc.).
A user can select a portion of a bar and drill through to another page. That page, of course, only shows data relevant to the particular bar and color selected.
I need a way to title the drill-through page that clearly indicates what was selected on the previous page (for example "Male" or "Asian" or "In-State"). The exact verbiage will vary depending on which parameter was chosen.
I am struggling to find the correct DAX syntax for that purpose.
Does any of that make sense?
Hi SusanRay
Is there any way you could come up with a sample report with fictional data and any past attempts at a solution?
1) Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
2) Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
3) Please explain how you would expect to get from step 1 to 2.
4) If possible, please show your past attempts at a solution.
- SusanRay2 years ago
Helper I
I really appreciate your help with this.
A trimmed-down copy of my project is available here: https://drive.google.com/file/d/1VmMU6fkARoUMBoOB2gvbr6YokO6hh_xb/view?usp=sharing
I added some text boxes on the various pages describing what I hope to see and what I have tried so far.
I feel like I must be missing something obvious because I cannot be the only person with this project requirement.
- gmsamborn2 years ago
Super User
Hi SusanRay
After looking at your pbix, I'm unsure how/where you are using [Drillthrough Title Piece].
Regardless, would this help?
Drillthrough Title Piece = VAR _ColorParm = SELECTEDVALUE( 'Color Parameter'[Color Parameter] ) RETURN IF( _ColorParm = "Overall", "Overall", IF( _ColorParm = "Gender", SELECTEDVALUE( 'Student Bio Demo'[Gender] ), IF( _ColorParm = "Race/Ethnicity", SELECTEDVALUE( 'Student Bio Demo'[Ethnicity Race Group] ), IF( _ColorParm = "Minority", SELECTEDVALUE( 'Student Bio Demo'[Minority] ), SELECTEDVALUE( 'Student Bio Demo'[Residency level] ) ) ) ) )- SusanRay2 years ago
Helper I
Hi gmsamborn ,
If you look at the Enrollment Count Detail Page, you will see a text box that includes the phrase (Color Parameter Selection). That is where I hoped to put the "Drillthrough Title Piece." (My bad. I wasn't consistent in my naming.)
Power BI did not throw an error when I created a measure using your proposed code. 🙂
But when I tried to 'add dynamic value' to the text box I am using for the title on the 'detail' page it wouldn't accept it. 😕
I then tried to add it as a table or a card, but it gave me a "Couldn't load the data for this visual" error. 😕
Specifically, it says,
As I said, I am very new to Power BI. This is supposed to be a Measure, right? Does it matter where that measure sits in my data?