Forum Discussion
Dynamic Text for a Drill Through
The following link refers to that error.
https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/
Maybe try this...
Drillthrough Title Piece =
VAR __SelectedValue =
SELECTCOLUMNS (
SUMMARIZE (
'Color Parameter',
'Color Parameter'[Color Parameter],
'Color Parameter'[p_Overall Fields]
),
"_Color",
'Color Parameter'[Color Parameter]
)
VAR _ColorParm =
IF(
COUNTROWS( __SelectedValue ),
MAXX(
__SelectedValue,
[_Color]
)
)
VAR _Logic =
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] )
)
)
)
)
RETURN
_Logic // corrected
We are getting closer.
An updated file is available here: https://drive.google.com/file/d/1AkwWiwWJlF3HzduyjFATpsp33aka8r_q/view?usp=sharing
I was able to create the measure using your code without a problem, and by adding the [ ] I got the dynamic text added to the text box. But it isn't giving me the information I am looking for.
Rather than repeating the Color Parameter, which it does now, I want it to show which aspect of the selected measure was chosen for the drill through. (For example, 'Female' for Gender. OR 'Asian' for Race/Ethnicity. OR 'International' for Residency')
Does that make sense?