Highlighting a series

Lorenzo Vercellati
Data Pied Piper
Published in
3 min readMay 3, 2021

A few weeks ago, I was working for a client to a line visual in a Power BI report . It was certainly not a difficult chart to make, but it was certainly difficult to read, because this visual had a dozen different series.

A color carnival

The client wanted the ability to select one series and highlight its performance relative to others. But the functionality of such a visual did not allow this in a clear and effective way. Clicking on an element of the legend at most resulted in a line highlighted with markers. But it was obviously not enough.

Better but not good enough

The customer in fact had in mind something like this:

The target

We were way off target and the client was already considering some custom visuals available on the marketplace. As you know, the marketplace is a very rich repository of alternative solutions, but since it’s not guaranteed that these custom visuals meet all the requirements of the default visuals, it’s good to make sure that it’s not really possible to get what you want with the default visuals before using the first ones.

So I tried a completely different approach to the problem.
Since the goal was to have one line stand out against a series of gray lines, why not handle each element as a separate object from the others but properly connected to them?
So we needed not one visual that did everything, but two line visuals and a slicer that managed the line to be highlighted.
First, I modified the original visual, putting the data color in gray for all the series and eliminating the legend.

Preparing the background

Then I duplicated the visual to get one with the same dimensions. From this second visual I removed the series, emptying out the Legend section and replaced the existing size with one created specifically for this purpose.
To create this measure, first I created a disconnected table from the dimension table from which I was generating the original series.
I would also need this table to feed the slicer I would create later.

A disconnected table could be the key!

So I created my measure, starting from the one used in the first visual and inserting it in a CALCULATE function where I placed the filter on the size equal to the value selected on the disconnected table just created.

The secret formula revealed

Now I just needed to create the slicer using the disconnected table and disconnect the first visual (the one with the gray lines) from the slicer using the edit interactions button.

Almost finished

The final step was to give the two line graphs the same dimensions, placing the one with the single line on top of the other, making sure the title, names and axis values matched.
And that was it!
No need for custom visuals…

Mission accomplished

--

--

Lorenzo Vercellati
Data Pied Piper

PowerBI Solutions Architect, SQLSat DIAD PPWT Speaker, Medieval History Graduated, Football Addicted, HomeBrewer, Springsteen & Pearl Jam Fan