As Power BI Developers our aim is to make data insights accessible universally, so that everyone can make full use of their data and the insights it holds.

Therefore it is critical to step out of our own shoes during the design process to ensure that what we build is inclusive to as many audiences as possible.

In this blog I will explore how you can implement dynamic alt-text using DAX measures, which help people who are blind or have low vision to explore our reports with ease using screen readers.

Note: This is a specific example of an accessibility feature within Power BI, there are other important design factors when building accessible reports which will not be covered in this blog.

For this example, I have built a data model and report on PGA tour stats from 2015 to 2022.

This uses “PGA Tour Golf Data – (2015-2022) dataset by Rob Mulla, available at https://www.kaggle.com/datasets/robikscube/pga-tour-golf-data-20152022, licensed under CC0”

The Design

  • The report has two pages
    • Tournament Overview
    • Player Strokes Gained
  • Data is slice-able by:
    • Course
    • Player
    • Tournament
    • Date
  • On the Player Strokes Gained page the visuals show:
    • How many tournaments the selected player has participated in
    • How many tournament wins the player has achieved
    • Shots gained stats for each category of shot
  • Icons and images are from Flaticon
  • Font used is Georgia
  • The report uses an accessible theme (Tidal in this case)
  • Visual components are to have alt-text to summarise what they are showing (Filter context must apply).

The Report Page

The Semantic Model

For this example we are going to create dynamic alt text that describes the clustered bar chart that displays average strokes gained by type.

Some Context for Non-golfers:

Strokes Gained indicates how much better or worse a shot was compared to what an average player would do from the same spot (same distance and lie).

If the average from 8 feet is 1.5 putts and you hole it in 1, you gain +0.5. If you take 2 putts, you lose −0.5.

The Strokes Gained stats are the average over a full tournament in this case. If multiple tournaments are selected, the average is taken of all of these.

The different types are based on where shots are taken from:

Alt Text Requirements

We want the screen reader to tell the user:

  • Which player are these stats for?
  • Which tournaments so these stats cover?
  • What were the average shots gained for each category?

Setup

We will create a table in our report where the alt text measures will live, I’ve called this “Alt Text Measures”:

The Performance Measures:

Our stats are calculated using the AVERAGE() and CALCULATE() functions, DAX definitions are as follows:

Off the Tee:

Approach:

Around-the-Green

Putting:

Our player slicer only allows ‘single selection’ so this will be relatively easy to reference in our dynamic alt text.

However, multiple tournaments will be able to be selected. We will need to create a measure to concatenate all selected tournaments and insert “and” between them.

This looks like the following:

If no tournaments are selected then we want the screen reader to acknowledge this, so we place our tournaments inside an IF() statement.

Then we will build our measure that will be used for our dynamic alt text.

The DAX for this is:

I have concatenated commas between each line to slow the narration down so it is easier to process (I toyed with multiple punctuation types and commas seem to work best in this case).

Finally, I assign this measure to our visual under the alt text option under the ‘General’ tab:

Testing

It is important to test our output to make sure it is understandable and says what we want it to.

To test our alt-text we can use our Windows narrator.

To activate this press the keyboard shortcut Ctrl + Windows + Enter.

Now when we click on our Clustered bar chat visual, the narrator will read our Dynamic DAX alt text!

When we click on the bar chart with the above filters, it will read as:

The Visual Title:

“Average Strokes Gained by Type”

The alt text DAX Measure Part

Selected Player:

“Tommy Fleetwood”

Selected Tournament/s:

“at BMW Championship and Genesis Open”

Stats:

“Off the Tee: zero point six four”

“Around the Green: zero point five three”

“Approach: zero point two three”

“Putting: minus zero point one six”

The Visual Type:

“Clustered Bar Chart”

This explains clearly to our user what the chart is displaying, what type of chart it is and gives them an audible breakdown of the players stats for their slicer choices.

I hope you found this blog useful, and you can now implement some of your own dynamic alt-text to make your reports a little more inclusive!

Tags: , , , ,