In this tutorial, we’ll be looking at a not-so-common custom visual called the Power BI slope chart. This chart is used to compare before and after results. It’s an effective way to show increase or decrease as well as magnitude for a single or multiple metrics.
Slope charts are used to analyze trends for data at a glance. They are also useful for comparing the correlation between data points based on time or other user-chosen parameters.
Sample Power BI Slope Chart
This part of the report is an example of a slope chart. However, this one has been created in Charticulator, and not from the marketplace. With Charticulator, I was able to create these lines where the red line belongs to the year 2020, the gray line belongs to 2019, and the yellow line belongs to year 2018.
It also shows that in 2020, the number of tickets issued was 605. Moreover, it took an average of 11 days to resolve a single issue. It also displayed the same information for the years 2018 and 2019.
This is a more complex example of a slope chart. In this part, I used issue types or the different types of tickets that were created by the employees for the IT department.
So, we have issue types here that are segregated by years. If we hover over here, we’ll see that the issue type is Task and the number of tickets resolved was 3. It also shows that the average number of days to resolve the issue was 454 days.
Creating A Custom Power BI Slope Chart
For this tutorial, we’ll try the custom visual slope chart from the marketplace. Let’s get that visual by clicking the 3 dots here. Then, click Get more visuals.
Search the slope chart on the search field, then click the Add button beside the Slope Chart by MAQ Software.
Add this custom visual on our report page and resize it as shown in the image.
Let’s add the Issue type on the Category field, and the Count Of Tickets Resolve on the Measure field.
As you can see, it displays “Please provide correct input data”. Hence, we need to modify our data for this visual to accept it.
The data that I used in the slope chart I created using the Charticulator looks like this.
In that example, I used the Issue Type, Year, Count Of Tickets Resolved, and Avg Days To Resolve measures.
However, for the slope chart visual that we are trying to use from the marketplace, we need to create separate measures for the number of tickets for 2018, 2019, and 2020. It will only accept data in the form of measures, not in the form of categories.
That’s another limitation of this custom visual: it only accepts 1 category value. So, let’s go back to our custom visual slope chart and use the separate measures that we’ve created.
Remove the Count Of Tickets Resolved in the Measure input.
Then, let’s add the measures for the number of tickets.
Another limitation of this visual is that it can only accept 2 measures. We can’t add the third measure in the Measure field. This is why we’ll just compare the number of tickets for the year 2019 and 2020 instead.
Now, we have this output. This output shows a trend where orange lines go downward and green lines go upward.
Modifying The Slope Chart
In the formatting tab, we can change the colors of the lines for upwards, downwards, and neutral under the Slope color.
We can also change the color for intercepts. There are many other options under the formatting tab that you can play with.
The only problem with this custom visual is that it can only accept 2 data values. It’s not picking another category as well. However, slope charts are used to tell stories between 2 data points. So, it’s still okay if it’s not accepting more than two measures.
In conclusion, a Power BI slope chart can be used to compare two data points. It’s an easy way to depict the difference between two times, two elements, or any other two attributes.
This chart can be fun and worthy to explore. If formatted well, it can clearly show whether a selection has improved or not. You can definitely do a quick comparison of growth or loss across categories with this chart visual.
Until next time,