Forum Discussion
Dynamic Text for a Drill Through
Here is a little more detail about what I am trying to do:
The last value I need to include in the title changes depending on the Color Parameter. So, I cannot simply use selectedvalue(Table[Gender])
Since Color Parameter =
{
("Overall", NAMEOF('Enrollment'[Overall]), 0),
("Gender", NAMEOF('Student Bio Demo'[Gender]), 1),
("Race/Ethnicity", NAMEOF('Student Bio Demo'[Ethnicity Race Group]), 2),
("Minority", NAMEOF('Student Bio Demo'[Minority]), 3),
("Residency", NAMEOF('Student Bio Demo'[Residency level]), 4)
I tried
Does this help? I think it was just a matter of incorrectly placed parentheses.
Drillthrough Title Piece =
IF(
'Color Parameter'[Value] = "Overall",
"Overall",
IF(
'Color Parameter'[Value] = "Gender",
SELECTEDVALUE( 'Student Bio Demo'[Gender] ),
IF(
'Color Parameter'[Value] = "Race/Ethnicity",
SELECTEDVALUE( 'Student Bio Demo'[Ethnicity Race Group] ),
IF(
'Color Parameter'[Value] = "Minority",
SELECTEDVALUE( 'Student Bio Demo'[Minority] ),
SELECTEDVALUE( 'Student Bio Demo'[Residency level] )
)
)
)
)
- SusanRay3 years ago
Helper I
Thank you for the response, gmsamborn .
Unfortunately, that did not work. The error message says "The syntax for 'Value' is incorrect."
- gmsamborn3 years ago
Super User
Hi SusanRay
I was just going by your definition for [Drillthrough Title Piece]. In you definition, you refer to Color Parameter without using quotes (ie. 'table') or square brackets ( ie. [measure] ). I have no way of knowing if that is a measure or a table (or even a column).
- SusanRay3 years ago
Helper I
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?