Dynamic Alt Text in Power BI: A Step-by-Step Guide

When building public-sector dashboards, accessibility is a priority. To clear a UK Government Digital Service (GDS) assessment, your reporting must meet WCAG 2.2 Level AA guidelines. For a recent dashboard project that focused on making an accessible dashboard, I needed to adhere to to these guidelines. My dashboard, made in Power BI, was about London Attractions Accessibility.

In Power BI, I used on a Field Parameter metric switcher to keep the page layout clean and simple (adhering to GDS Principle 4). This allows users to click a single row of button tiles to instantly switch the main bar chart across four separate views: Accessible Toilets, Station Step-Free Access, Venue Step-Free Access, and Sensory Guides.

However, this feature introduces an accessibility flaw: if the chart's Alt Text (text-to-speech readable text for users with screen readers) remains static when a new metric is selected on the metric switcher, it will give the user incorrect information. To fix this, we can write a short DAX script that automatically updates the chart's screen-reader narrative and analytical insights based on what the user has selected in the metric switcher parameter.

To pass a GDS audit, your Alt Text cannot simply say "This is a bar chart." Sighted users can easily spot who is leading, what the volumes look like, and if there are data gaps. To provide the full user experience to all users, your screen-reader text must deliver those exact same analytical insights. Here is the exact DAX measure I used to handle the switches safely:

Dynamic_Chart_Alt_Text =
VAR ChosenView = CONCATENATEX('Select Accessibility View', 'Select Accessibility View'[Select Accessibility View], ", ")
RETURN
SWITCH(
TRUE(),
CONTAINSSTRING(ChosenView, "Toilets"),
"Horizontal stacked bar chart showing the count of attractions with accessible toilets by London borough. All nineteen tracked attractions across all boroughs are equipped with accessible toilets, with Lambeth and Westminster leading the dataset with three accessible venues each.",

CONTAINSSTRING(ChosenView, "Station"), 
"Horizontal stacked bar chart tracking transit infrastructure connectivity. Out of nineteen total venues, sixteen are served by a nearest London Underground station that provides full street-to-platform step-free access, with Lambeth, Westminster, and Camden containing the highest concentration.",

CONTAINSSTRING(ChosenView, "Venue Step-Free Access"), 
"Horizontal stacked bar chart displaying the on-site physical accessibility of tourist venues. Out of seventeen total attractions with step-free access, Lambeth and Westminster lead with three each. Only two venues across the entire dataset feature partial access.",

CONTAINSSTRING(ChosenView, "Guides"), 
"Horizontal stacked bar chart displaying sensory and communication inclusion. It tracks the twelve venues that provide British Sign Language (BSL) or descriptive audio guides, showing that Westminster and Lambeth provide the highest volume of sensory-inclusive options, although most boroughs have some venues that do not offer sensory options. Lewisham and Richmond upon Thames have no sensory options in their venues.",

"Horizontal stacked bar chart displaying a breakdown of London tourist attraction infrastructure metrics by borough. Please utilize the toggle slicer to select a specific accessibility profile view."

)

I used pre-made strings to describe what was happening on the chart, and these are returned based on which text is returned by the metric parameter switcher. I used CONTAINSSTRING for this because functions like SELECTEDVALUE cannot read field parameters directly and often return a blank when a user clicks a button.

To hook this up, open the Format visual pane for your bar chart, head to General, and expand the Alt text properties. Click the conditional formatting fx button next to the text entry box and assign your new dynamic measure using the Field value option.

This setup ensures your dashboard provides the full user experience to all users. Screen-reader users get the exact same real-time insights as sighted users the second a filter changes, creating a genuinely equal user experience.

Author:
Martin Regan
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2026 The Information Lab