Forum Discussion
afkhalifeh
2 years agoFrequent Visitor
Changing Visual Title Dynamically in Power BI Desktop
I have 4 visuals; I need a way to change the title dynamically of each visual based on the selected value for a slicer and based on the visual name itself. For example, the title of the visual one m...
- 2 years ago
Hey afkhalifeh ,
you can create 4 measures, one for each visual. Then use each measure as dynamic title for a visual accordingly:
A measure might look like this:
vizAid vis1 title = var selectedLanguage = selectedvalue( 'languagetable'[LanguageId] , "<defaultlanguageId") return calculate( firstnonblank( 'languagetable'[Title] , 0 ) , 'languagetable'[LanguageId] = selectedLanguage , 'languagetable'[VisualId] = "the ID of the viusal" )Hopefully, this provides what you are looking for.
Regards,
Tom
TomMartens
Super User
2 years agoHey afkhalifeh ,
you can create 4 measures, one for each visual. Then use each measure as dynamic title for a visual accordingly:
A measure might look like this:
vizAid vis1 title =
var selectedLanguage = selectedvalue( 'languagetable'[LanguageId] , "<defaultlanguageId")
return
calculate(
firstnonblank( 'languagetable'[Title] , 0 )
, 'languagetable'[LanguageId] = selectedLanguage
, 'languagetable'[VisualId] = "the ID of the viusal"
)
Hopefully, this provides what you are looking for.
Regards,
Tom
- afkhalifeh2 years agoFrequent Visitor
Many thanks, Tom for the reply.
Is it possible to create one measure for all of the 4 visuals?