Ravindra BagaleCourses & study guides मराठी Track your progress

20. Dynamic Text and Dynamic Colour (Conditional Formatting)

20.2 Dynamic Titles with Measures

Start with a problem

Shraddha exports a screenshot of a Nashik-only chart and her boss thinks it shows all of Maharashtra.

Explain simply

A dynamic title measure writes the current filter into the title, so every screenshot explains itself.

Show the data

City selected Total Sales (₹)
None 2,100
Nashik 800
Pune 850

About this data: This table uses columns: City selected, Total Sales (₹). This table uses columns: Slicer, Title. This table uses columns: City slicer, Title shows. Values shown are the lesson examples already on this page (not a new dataset).

Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv (source: src/practice/).

Demonstrate

  1. Create Dyn Title = "Total Sales: " & FORMAT([Total Sales], "₹#,##0") & " – " & SELECTEDVALUE(Orders[City], "All cities").
  2. Chart › Format › General › Title › fx › Field value › Dyn Title.
  3. Select Nashik.

Show the result

Your result should look like this (fictional sample):

Slicer Title
None Total Sales: ₹2,100 – All cities
Nashik Total Sales: ₹800 – Nashik

Explain what happened

FORMAT converts the measure into text with the ₹ pattern; & joins the pieces.

Explore further

  • Keep titles short; one key fact is enough.

Detailed reference for this lesson:

Dynamic title with a measure in Power BI with example — in 30 seconds

What: A dynamic title changes with the slicer. It comes from a text measure.

Why: A screenshot titled "Sales by Store" does not say which city it shows. "Sales by Store – Nashik" does.

Tiny example: City slicer = Nashik, then the title reads "Sales by Store – Nashik". Nothing selected, then "– All cities".

First look at the data (before, then after):

Dynamic title with a measure in Power BI with example: before and after tables, fictional Blinkit Maharashtra data

Same before / after tables as text

Before — Static title

City slicer Title shows
Nashik Sales by Store
(nothing) Sales by Store

Formula / click path

Title Store Sales = "Sales by Store – " & SELECTEDVALUE(DarkStore[City], "All cities")
Visual › Format › General › Title › fx › Field value = Title Store Sales

After — Dynamic title

City slicer Title shows
Nashik Sales by Store – Nashik
(nothing) Sales by Store – All cities
Pune + Nashik Sales by Store – All cities (fix in 20.3)

Do it step by step:

  1. Click Home › New measure. Type the Title Store Sales formula.
  2. Select the bar chart. Open Format › General › Title.
  3. Click the fx button next to Text.
  4. Format style: Field value. Field: Title Store Sales. Click OK.
  5. Select Nashik in the slicer. Check the title.
  6. Select two cities. The title says "All cities". Fix that with CONCATENATEX in 20.3.

Steps in Power BI

  1. Create the measure (below) with Home › New measure. It must return text.
  2. Select the chart › Format visual › General › Title › Text › click fx.
  3. Format style: Field value; What field should we base this on?: [Title Orders by City] › OK.
  4. Change the Platform and Month slicers. The title changes, e.g. "Blinkit orders by city – Oct 2025".
Selected Platform = SELECTEDVALUE(Orders[Platform], "All platforms")

Title Orders by City =
VAR p = SELECTEDVALUE(Orders[Platform], "Blinkit + Amazon Now")
VAR m = IF(HASONEVALUE('Date'[Year Month]), FORMAT(MAX('Date'[Date]), "mmm yyyy"), "selected period")
RETURN p & " orders by city – " & m

SELECTEDVALUE(column, alternate) returns the value when exactly one is selected, otherwise the alternate text.

Got it? No selection, one selection, many selections – test all three cases.

Ravindra Bagale's Tip

Friends, pay attention: a dynamic title that shows "Sales for Pune" when nothing is selected is misleading. Handle the "no selection" and "multiple selection" cases in the measure, for example with SELECTEDVALUE(DarkStore[City], "All cities"). Test the title with zero, one and several cities selected. Don't make this mistake!

Fix common mistakes

Wrong result Reason Correction
Title shows 800 without ₹ No FORMAT Use FORMAT with a ₹ pattern
FORMAT makes the number left-aligned text elsewhere Using FORMAT in a numeric measure Use FORMAT only in text measures
Title too long Too many parts Keep to one sentence

Practise independently

Practice task

Write the title shown for Kolhapur.

Hints
  • Kolhapur total 450.
Solution

Total Sales: ₹450 – Kolhapur.

Think like a professional

Self-explaining visuals save meetings. It is a small DAX skill with high business value.

Loading DAX practice tasks...

  1. City title (Easy): Slicer: Store City = Pune. Measure: Title = "Sales for " followed by the picked city, or "All Cities" when none or many.
  2. Title with no slicer (Easy): No slicer. Measure: Title = "Sales for " and the picked city, else "All Cities".
  3. Two cities picked (Easy): Slicer: Store City = Pune and Mumbai. Measure: Title = "Sales for " and the picked city, else "All Cities".
  4. Platform title per row (Easy): Shown per Platform. Measure: App Title = "App: " and the platform.
  5. FY in the title (Medium): Slicer: FY = FY 2025-26. Measure: FY Title = "Sales in " and the picked FY, else "all years".
  6. City and FY together (Medium): Slicers: Store City = Nashik and FY = FY 2024-25. Measure: Full Title = "Sales for ", the city or "All Cities", " in ", the FY or "all years".
  7. Filtered or not (Medium): Slicer: Store City = Mumbai. Measure: Filter Note = "Filtered by city" if Store City is filtered, else "All cities".
  8. No filter note (Medium): No slicer. Measure: Filter Note = "Filtered by city" if Store City is filtered, else "All cities".
  9. One app or many (Hard): Slicer: Platform = Blinkit and Zepto. Measure: App Note = "One app: " and the app if exactly one is picked, else "Many apps".
  10. City title per row (Hard): Shown per Store City. Measure: Row Title = the city followed by " store sales".

Ravi Sir's Cards for this lesson

मराठी cards