Forum Discussion
Dynamic title based on slicer
Hi BI Gurus,
I wrote a measure to show the filter results as a chart title. The filter has 2 layers, Industry and Function, and users can choose multiple selections on both levels. I was hoping the title could change in the following 3 scenarios
1. If no specific function or industry is selected in the filter, write the title as "Noise Quartiles for ALL function in ALL industry"
2. If a specific function or industry is selected in the filter, write the title as "Noise Quartiles for <dynamic function name> function in <dynamic industry name> industry "
3. If function or industry has multiple selections, write the title as "Noise Quartiles for SELECTED function in SELECTED industry"
The current measure I have only provides the first 2 scenarios, but not fit for the 3rd scenario. I am wondering how to achieve the 3rd one? Thank you so much in advance!
Anonymous
Please check this Solved: Dynamic title based on two slicers - Microsoft Power BI Community
Regards,
Ritesh
2 Replies
- ribisht17Super User
Anonymous
Please check this Solved: Dynamic title based on two slicers - Microsoft Power BI Community
Regards,
Ritesh
- AnonymousNot applicable
Thanks Ritesh!!
Here is the full code I used to pull it through -
Titlename =Var _Fun = isfiltered('Noise quartile function'[Function])Var _ind = isfiltered('Noise quartile function'[Industry])return"Noise Quartiles for " &switch (true(),and(_Fun , not ( _ind )), "all industries in " & concatenatex (values('Noise quartile function'[Function]),'Noise quartile function'[Function],", ") & " function",and(_ind , not ( _Fun )), "all functions in " & concatenatex (values('Noise quartile function'[Industry]),'Noise quartile function'[Industry],", ") & " industry" ,and(_Fun = TRUE, _ind = TRUE), concatenatex(values('Noise quartile function'[industry]),'Noise quartile function'[Industry],", ") & " industry in " & CONCATENATEX( values('Noise quartile function'[Function]), 'Noise quartile function'[Function],", ") & " function", "all functions and industries" )