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
- Create
Dyn Title = "Total Sales: " & FORMAT([Total Sales], "₹#,##0") & " – " & SELECTEDVALUE(Orders[City], "All cities"). - Chart › Format › General › Title › fx › Field value ›
Dyn Title. - 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".
Dynamic title with a measure in Power BI with example — 30 सेकंदात
काय: Dynamic title slicer सोबत बदलतो. तो एका text measure मधून येतो.
का: "Sales by Store" title असलेल्या screenshot वरून कोणतं शहर आहे ते कळत नाही. "Sales by Store – Nashik" वरून कळतं.
छोटं उदाहरण: City slicer = Nashik, then title "Sales by Store – Nashik" दिसतो. काहीच निवडलं नाही, then "– All cities".
Dynamic title with a measure in Power BI with example — 30 सेकंड में
क्या: Dynamic title slicer के साथ बदलता है. वह एक text measure से आता है.
क्यों: "Sales by Store" title वाले screenshot से पता नहीं चलता कि कौन-सा शहर है. "Sales by Store – Nashik" से चलता है.
छोटा उदाहरण: City slicer = Nashik, then title "Sales by Store – Nashik" दिखता है. कुछ नहीं चुना, then "– All cities".
First look at the data (before, then after):
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:
- Click Home › New measure. Type the Title Store Sales formula.
- Select the bar chart. Open Format › General › Title.
- Click the fx button next to Text.
- Format style: Field value. Field: Title Store Sales. Click OK.
- Select Nashik in the slicer. Check the title.
- Select two cities. The title says "All cities". Fix that with CONCATENATEX in 20.3.
एक-एक step करून बघा:
- Home › New measure वर click करा. Title Store Sales formula type करा.
- Bar chart निवडा. Format › General › Title उघडा.
- Text शेजारच्या fx button वर click करा.
- Format style: Field value. Field: Title Store Sales. OK करा.
- Slicer मध्ये Nashik निवडा. Title तपासा.
- दोन शहरं निवडा. Title "All cities" म्हणतो. ते 20.3 मध्ये CONCATENATEX ने fix करा.
एक-एक step करके देखिए:
- Home › New measure पर click कीजिए. Title Store Sales formula type कीजिए.
- Bar chart चुनिए. Format › General › Title खोलिए.
- Text के बगल वाले fx button पर click कीजिए.
- Format style: Field value. Field: Title Store Sales. OK कीजिए.
- Slicer में Nashik चुनिए. Title जाँचिए.
- दो शहर चुनिए. Title "All cities" कहता है. उसे 20.3 में CONCATENATEX से fix कीजिए.
Steps in Power BI
- Create the measure (below) with Home › New measure. It must return text.
- Select the chart › Format visual › General › Title › Text › click fx.
- Format style: Field value; What field should we base this on?:
[Title Orders by City]› OK. - 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.
समजलं का? Selection नसेल, एक असेल, अनेक असतील – तिन्ही case test करा.
समझ आया? Selection न हो, एक हो, कई हों – तीनों case test कीजिए.
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!
Ravindra Bagale's Tip – मराठी
मित्रांनो, लक्ष द्या: काहीच select केलेलं नसताना "Sales for Pune" दाखवणारा dynamic title दिशाभूल करतो. Measure मध्ये "no selection" आणि "multiple selection" हे cases handle करा, उदाहरणार्थ SELECTEDVALUE(DarkStore[City], "All cities") ने. शून्य, एक आणि अनेक cities select करून title test करा. ही चूक करू नका!
Ravindra Bagale's Tip – हिंदी
दोस्तों, ध्यान दो: कुछ भी select न होने पर "Sales for Pune" दिखाने वाला dynamic title गुमराह करता है. Measure में "no selection" और "multiple selection" वाले cases handle करो, जैसे SELECTEDVALUE(DarkStore[City], "All cities") से. शून्य, एक और कई cities select करके title test करो. यह गलती मत करना!
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...
- City title (Easy): Slicer: Store City = Pune. Measure: Title = "Sales for " followed by the picked city, or "All Cities" when none or many.
- Title with no slicer (Easy): No slicer. Measure: Title = "Sales for " and the picked city, else "All Cities".
- Two cities picked (Easy): Slicer: Store City = Pune and Mumbai. Measure: Title = "Sales for " and the picked city, else "All Cities".
- Platform title per row (Easy): Shown per Platform. Measure: App Title = "App: " and the platform.
- FY in the title (Medium): Slicer: FY = FY 2025-26. Measure: FY Title = "Sales in " and the picked FY, else "all years".
- 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".
- Filtered or not (Medium): Slicer: Store City = Mumbai. Measure: Filter Note = "Filtered by city" if Store City is filtered, else "All cities".
- No filter note (Medium): No slicer. Measure: Filter Note = "Filtered by city" if Store City is filtered, else "All cities".
- 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".
- City title per row (Hard): Shown per Store City. Measure: Row Title = the city followed by " store sales".
Revision card
Interview card