Creating a Linear Gauge with Multiple Targets in Power BI

Creating a Linear Gauge with Multiple Targets in Power BI

Have you ever wondered if it’s possible to have a linear gauge with not just one, but two target lines?  Recently while discussing with someone this question came up and I found the idea intriguing and started visualizing how this feature could enhance data visualization. To my surprise when I researched on this feature, I barely found any content addressing this topic. So, here I am, sharing some of my insights on creating a linear gauge with multiple targets.

In this article, we’ll explore three important questions about the gauge with multiple targets:

  1. Why It’s Helpful

  2. When Do We Need It?

  3. How to Create One in Power BI Using Bar Chart?

Let's start with the topic.

Why It’s Helpful

Here are the reasons why Actual and Target comparisons are helpful and the role of multiple targets.

  • An Actual and Target comparison helps track deviation in the performance.

  • When you want to compare your actual value against a forecasted target.

  • An Actual and Target comparison is helpful when we want to track crucial KPIs regularly.

  • An Actual and Target comparison is helpful when we want to read multiple categories against a metric on the same scale at a glance.

  • A gauge and multiple target line visuals are flexible to use across a wide range of business requirements.

When Do We Need It?

The previous section talked about why a Gauge is helpful. Let's dig in more and find out the specific cases where 2 targets are helpful.

  • When we want to display a goal, the current data set and previous datasets are all in one visualization.

  • Multiple target lines can be helpful when you want to display primary and secondary targets. E.g. You want to compare actual sales performance with last year's sales as well as the projected sales for this year. When comparing values against average, median, or mode in statistics.

  • When your multiple targets are independent of each other. Grouped targets, on the other hand, are treated as a single unit. If a group has multiple targets they get separated as bands: bad-neutral-good

  • Multiple target lines can help understand performance against various benchmarks. E.g. You want to rate a movie against IBDM and Rotten Tomatoes ratings for the given genre.

How to Create One in Power BI Bar Chart?

I didn't find any radial or linear gauge that offers this feature. So I decided to re-create something similar using the Power BI Bar chart. Follow these step-by-step guides.

Step-by-Step Guide

  1. Create the Measures: Use DAX formulas to calculate the measures mentioned above. For example:ss

2. Create a Stacked Bar Chart:

  • Use “Month Name” as the Y-axis and plot Total Sale and Remaining on the X-axis.

  • Color the remaining bar in light grey and the total sale bar in a primary color (e.g., yellow, blue).

3. Add Reference Lines for Targets:

  • Insert constant reference lines for Total Cost and Sale LM. These lines represent your dual targets.

4. Format and Style: Customize the chart’s appearance:

  • Add descriptive legends.

  • Apply border roundness and shadows for a modern look.

5. Enhance Tooltip Readability: Create a tooltip measure (e.g., PY Tooltip) to display relevant information:

  • Show the Total Cost and the percentage difference from the Total Sale.

  • Use arrows (⬆ or ⬇) to indicate positive or negative trends.

6. Review and Refine: Compare your result with the expected outcome. Adjust styling as need

By following these steps, you’ll have a linear gauge with two target lines, providing richer insights into your data.

I hope these DAX and information are helpful.

Syed Kamran Javaid

Senior Business Data Analyst at Saudi Aramco...talk to me about #dataanlytics #dataengineering #data visualization #ETL

7mo

the step to add legends is unclear.

Like
Reply
Thameur OMRANI

🚀 Directeur de projets ITSM/ESM & Transformation Digitale | AI & Innovation 🤖 | Expert PowerBI 📊

1y

Merci pour l’astuce Ghassen Khammouma 📈⚡️ 💡🚀

To view or add a comment, sign in

Others also viewed

Explore topics