Our challenge for today is to help create a dynamic title in Power BI that changes based on filter selections.
Keep dynamic title measures as text
A dynamic report title should usually be a text measure, even when it includes numbers or dates. Use SELECTEDVALUE, CONCATENATEX, or conditional logic to build a readable sentence, then bind that measure to the visual title with conditional formatting. Do not reuse a numeric measure directly as a title unless the visual only needs that raw value.
When the title includes formatted numbers, decide whether the formatting belongs in the title measure or in the underlying measure. Power BI supports model, visual, and dynamic format strings for numeric values, but a title is displayed as text. Test the title with no slicer selection, one selected value, and several selected values so users do not see blanks or misleading single-category wording.
Change report title text based on selection
Data Preparation
- Lauch Power BI Desktop
- Start by creating an EmployeeData table containing the following columns: EmployeeID (Integer), Name (Text), Department (Text), HireDate (Date) and Salary (Decimal).
Create dynamic measures
- Next, in the Modeling section, create individual measures for the different filter selections using the following DAX commands:
Selected Department =
IF(ISFILTERED(EmployeeData[Department]),
VALUES(EmployeeData[Department]),
"All Departments")
Selected Year =
IF(ISFILTERED(EmployeeData[HireDate]),
FORMAT(MAX(EmployeeData[HireDate]), "yyyy"),
"All Years")
Last, go ahead and combine measures into a dynamic title:
Dynamic Title =
"Employee Report: " & [Selected Department] & " - " & [Selected Year]
Explanations to comprehend the DAX code:
- The IF(ISFILTERED()) function checks if a filter is applied
- VALUES() returns the currently selected filter value
- Combining measures allows us to build a flexible title that is responsive to the user selection.
Add a card visual to your Power BI report
- Drag the [Dynamic Title] measure onto the canvas
- In the Visualizations pane, select the Card visual.
- Next, go ahead and format the card visual:
- In the Format pane, expand the Title section. Then set the Title text to “blank” (remove default title)
- Under Data label, increase the font size (e.g., 18 pt)
- Optionally, adjust colors and alignment as needed
Create slicers for dynamic title text selection
- Drag the Department and HireDate fields onto the canvas
- Highlight each of the fields in the canvas, and change their visual type to Slicer
Test the dynamic title by selecting different departments and years in the slicers
Common Issues when changing titles based on filters
- Title not updating: to fix this, ensure slicers are properly connected to the report page.
- Multiple values in title – Use CONCATENATEX() instead of VALUES() for multi-select scenarios.
- Blank title: Verify that measures are correctly referenced and calculated.