Forum Discussion
Dynamic Title Based on Slicer Options
- 9 years ago
Check out this BLOG for exact solution.
How to create a Dynamic title based on Slicer Option/Selection?
The following solution shows how to create a "Title" that changes according to the "Option" that you click on your slicer.
EXAMPLE:
- I have a slicer by Year which has two (2) options: 2020 and 2021. (Ensure your slicer is "ON" for Single Select)
- This date slicer is created from a "Calendar" Table that has all the Date Hierarchies.
- When I click "2020" on the Year Slicer, Title should change to "Sales Data for the Year Ending 2020".
- When I click "2021", on the Year Slicer (since Single Select is ON, Year 2020 will be automatically unselected), Title should change to "Sales Data for the Year Ending 2021".
SOLUTION:
1) Create a Measure on Power BI
2) Input the following DAX Formula (change the table, columns and title header accordingly):
DAX FORMULA:
Dynamic Title =
VAR GetValues= CONCATENATEX(
VALUES('Calendar'[Date].[Year]), 'Calendar'[Date].[Year], ", ")
RETURN
"SALES DATA FOR THE YEAR ENDING " & GetValues & " "
3) Create a Card Visual and input the Dynamic Title Measure
4) Drag and place the Dynamic Title Card Visual above the targeted Visual (in this case the Sales data visual)
5) Now, when you click on the Year slicer Options, the tilte should change accordingly.
Thank you.