In this tutorial, we will learn how to create dynamic titles in Power BI that change based on user selections from a slicer. By using DAX measures, we can customize titles for visuals to reflect specific data
Prepare Your Data Model
Ensure your data model includes the necessary fields for the slicer filter, such as categories, regions, or other dimensions that the user will select from. You should also have the corresponding data that you want to visualize.
- Create the slicer with the desired field (e.g., Country, Region, Product) for filtering.
- Ensure the slicer is linked to the relevant data table in your model.
Create DAX Measures for Dynamic Titles
Create a Measure for the Title
Create a New Measure for your dynamic title. Use the SELECTEDVALUE function to capture the selected value from the slicer.
Dynamic Title =
VAR selectedValue = SELECTEDVALUE('YourTable'[YourColumn])
RETURN
IF (
NOT ISBLANK(selectedValue),
"Your Title - " & selectedValue,
"Your Default Title"
)
Example
Country wise sales title =
VAR selectcountry = SELECTEDVALUE('Tbl_Sales_Territory_data'[Country])
RETURN
IF (
NOT ISBLANK(selectcountry),
"Product Category Wise Sales -" & selectcountry ,
"Product Category Wise Sales"
)
Fiscal year wise sales title =
VAR selectcountry = SELECTEDVALUE('Tbl_Sales_Territory_data'[Country])
RETURN
IF (
NOT ISBLANK(selectcountry),
"Fiscal Year Wise Sales Summary -" & selectcountry,
"Fiscal Year Wise Sales Summary"
)
These two DAX measures will ensure that your report titles dynamically update based on the country selected in the slicer, providing a clear and contextual view of the data.
Apply the Dynamic Title to Visuals
- Select the Visual:
Click on the visual (e.g., bar chart, pie chart, etc.) where you want to apply the dynamic title. - Configure Title Settings:
- Go to the Format pane.
- Under Title, toggle the option to On.
- In the Title Text field, select the dynamic title measure you created in Step 2.




Test the Interaction
- Test with Different Slicer Selections:
Test your report by selecting different options in the slicer. Ensure that the title updates dynamically based on the selected value. - Ensure Default Behavior:
When no selection is made in the slicer, verify that the default title is displayed, as intended.
Before Slicer value Select

After Slicer value Selected

Before a user selects any specific country from the slicer filter, the graph will display data for all countries. This provides a comprehensive overview of the entire dataset, allowing the user to see aggregated information across all regions.
Once a user selects “France” from the slicer, the graph will update to show data exclusively for France. Additionally, the graph titles will dynamically change to reflect the selected country, providing a clearer context for the displayed information.
The title “Product Category Wise Sales” will change to “Product Category Wise Sales – France.”
Similarly, “Fiscal Year Wise Sales Summary” will update to “Fiscal Year Wise Sales Summary – France.”
This dynamic title update, based on the selected country, enhances the user experience by clearly indicating which country’s data is being displayed, making it easier to interpret and analyze the information.
For More Power BI Related Content: https://learntodatascience.com/power-bi/
Download Power BI Desktop : https://www.microsoft.com/en-us/download/details.aspx?id=58494



