Saturday 10 July 2021

Experience with the Power BI Visio visual

A couple of weeks ago I was given the opportunity to monitor a couple of sessions for Data Saturday ANZ. One of those sessions was Scott Helmer's talk Data in Context: Add Value by Embedding Visio Diagrams in Power BI Reports

Scott presented on the data capabilities in Visio, and how it can be integrated into Power BI. Visio has data fields behind the shapes in diagrams. It has good support for pulling in data from spreadsheets or CSVs, linking that data to shapes by an ID column, and refreshing the shape data fields from the external source. It also supports call-out text and conditional colouring. I wasn't aware of these features, they would be a great timesaver over manually updating the shapes in a floorplan when the situation changes. 

The other item Scott introduced us to was the Visio visual for Power BI. I was impressed with what he showed us, and thought it would be nice to get some experience with the visual. The most recent use-case I've had for Visio was a floor plan, and I had recently found this reddit post of a floor plan of the TV show The Office. I decided to overlay data over that floorplan from Power BI and went with two datasets – lines by character over each season of the show, and the average positive or negative sentiment of the lines spoken by each character (1 = positive, 0 = mixed or neutral, -1 = negative).

Introducing the visual
The Power BI visual has its own feature to support field mapping to shapes and allows you to add multiple fields from the dataset to the visual. Field values can be shown within shapes as shape colour, or text positioned in the shape.

I was surprised that data graphic conditional formatting isn’t updated in the Power BI Visio visual – instead the Power BI visual seems to see the Visio shapes as just shape map shapes, each with an associated ID. I had spent quite a while getting my Visio shape data graphics to look nice in Visio, then discovered that these could change based on my Power BI filters. Having those existing shape data callouts not updatable in Power BI seemed a missed opportunity.

The Power BI visual has good two-way interaction with other visuals in a Power BI report. When I select a slicer in Power BI, the linked Visio element is selected (highlighted by an green square around it) or filtered, depending on the Power BI visual interaction setting. Also, when a shape with an ID is selected in the visual, it acts as a filter for other elements on the Power BI report. This two-way interaction is what makes Visio lead over an alternative solution using Power BI shapes.

Filtering the Power BI Visio visual by selecting items, and using a slicer.

Usefulness of the visual

The floor plan overlaid with average sentiment rating of spoken lines, with a play slicer slicing on seasons gave an interesting view over the change in characters over seasons of the show, showing that there is usually one character who is more negative than positive in each season, switching between Angela, Phyllis, Toby, Kelly, and Stanley.

While viewing sentiment analysis aggregated at the series level, things stayed reasonably stable.  When increasing the level of detail to episode level it produced a more dynamic sentiment map. I guess this is a reminder that we all have good days and bad days.

Below is a GIF of the sentiment analysis changing per episode.

Floor plan of office sentiment, slicer on seasons and episodes, showing often-changing stats.


I was also surprised to see background characters present but with 0 lines during some episodes. I could have added rows indicating 0 lines so they still showed. It must be understated form of acting being one of these actors, just being present.

Perhaps creating a floorplan showing network traffic or active hours for each computer would be a real-world use-case. Use-cases that require displaying spatial relationships could also benefit from the visual.

Here is my use-case of the Visio visual acting as a filter for a more dynamic experience, showing an example positive and negative line from the character selected in the visual.

Filtering a character profile from a Visio diagram



What worked best for me
I had the most success when I leaned fully into the idea that “in the Visio visual, shapes are just a shape with an ID”, using the Visio visual’s “display as text” and “display as conditional colour” field settings instead of the shape data graphic features in Visio. 

The sentiment analysis page with shape text and colouring being mapped from Power BI is used in the above GIF. Also, note the non-standard shape of Erin's desk - that's a Visio stencil.

Using text and colour from Power BI meant that if there is no data for a specific shape in the current filter context, it disappears from the visual (white or default fill, no text). You can see this in Erin, Creed, and Andy’s desks for season 1.

One limitation of this approach was that with the text values for people’s names coming from Power BI, which doesn’t support shape text font, I couldn’t customize the text to use Courier New. Keeping them as Segoe UI is probably optimal given the small size in my case.

Also, using Visio objects also gives access to the rich library of Visio shapes – this isn’t something that I would expect to find in other potential solutions. An example of this is the shape of Erin’s desk.

A possible reliability issue
Either the shape data graphics or the linking of the shapes and data fields seemed to intermittently fail, with shape colouring remaining in Power BI, but any elements not in the Power BI dataset going dark blue (instead of the fill colour white), and text labels (using Visio shape data graphics) disappearing. This issue appeared in the visual on Power BI Desktop which persisted when I’d published to the web. I could not work out what was causing this, and changing and saving after making sometimes trivial changes resolved the issue. I suspect it could be some sort of caching in the Power BI visual.

How this could be taken further
I’ve used a layout that makes the text too small to easily read. The Visio visual has a setting to automatically zoom into the selected shape(s), however I wanted the entire floor plan to be visible so didn’t enable this.

Also, I linked character names as IDs and assumed nobody moved position or was replaced. This isn’t correct. Using IDs tied to each desk would be a more true-to-life identifier, with the character name and lines/sentiment as fields in the values field-well.

Conclusion
The Visio visual for Power BI is a powerful tool for the use-case where a flowchart or floorplan needs to be included in a Power BI report. It’s a niche case, but I’m glad to have a good tool if that need ever comes up.