Skip to main content

Target vs Actual Bar

The Target vs Actual Bar shows a single metric as a slim bar sitting on shaded poor, ok, and good bands with a target marker, so a reader sees at a glance not just the number but whether it clears the goal. It is built with a standard Microsoft List and a small piece of column-formatting JSON applied to a number field. The value bar grows along a 0 to 100 track, the three qualitative bands and the target tick are set in the JSON, and the exact number sits at the end of the bar.
Author
SharePoint Maven
Built with
Features
JSON, Number Column, Single Line of Text Column
Category
Formatting

Want one like this?

Talk to Greg
  • Shows a metric as a bar over shaded poor, ok, and good bands, so context comes with the number
  • A target tick marks the goal, so clearing or missing it reads instantly
  • The value bar grows along a fixed 0 to 100 track for easy row-to-row comparison
  • The bands and the target position are set in the JSON and are easy to move to your own thresholds
  • The exact value sits at the end of the bar, so you get the picture and the precise figure
  • Applied as column-formatting JSON on a number field, so it changes nothing about the underlying data
  • KPI attainment against a target on a scorecard
  • Sales or quota progress by rep or region
  • Service levels or CSAT against a goal
  • Budget consumed against a cap
  • Completion or readiness against a threshold
  • Any 0 to 100 metric measured against a target
  • Design Pattern: Metrics & Progress
  • Format Scope: Column
Display nameColumn typeInternal name
MetricSingle line of text[Title]
AttainmentNumber[Attainment]
  1. Build a list with these columns before you paste the JSON.
  2. Then populate the list with data on a 0 to 100 scale.
  3. Because the JSON is applied at the column level, the Attainment column can use any name you want.
  4. The band splits and the target tick (at 80 percent) live in the JSON – move them to match your own goal.
  5. Store the value in a Number column on a 0 to 100 scale (a decimal such as 0.73 will not display as 73 percent); the 80 percent target is fixed in the JSON and is not read from a separate Target column.
  1. On the Attainment column, open the column header menu, choose Column settings, then Format this column.
  2. Switch to Advanced mode.
  3. Paste the JSON below and click Save.
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "display": "flex",
    "align-items": "center",
    "height": "100%"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "position": "relative",
        "width": "170px",
        "min-width": "170px",
        "max-width": "170px",
        "height": "20px",
        "min-height": "20px",
        "max-height": "20px",
        "border-radius": "4px",
        "overflow": "hidden",
        "background-color": "#f3f2f1"
      },
      "children": [
        {
          "elmType": "div",
          "style": {
            "position": "absolute",
            "left": "0",
            "top": "0",
            "width": "34%",
            "height": "100%",
            "background-color": "#f3b8ae"
          }
        },
        {
          "elmType": "div",
          "style": {
            "position": "absolute",
            "left": "34%",
            "top": "0",
            "width": "33%",
            "height": "100%",
            "background-color": "#f7dd94"
          }
        },
        {
          "elmType": "div",
          "style": {
            "position": "absolute",
            "left": "67%",
            "top": "0",
            "width": "33%",
            "height": "100%",
            "background-color": "#a8d8a3"
          }
        },
        {
          "elmType": "div",
          "style": {
            "position": "absolute",
            "left": "0",
            "top": "30%",
            "height": "40%",
            "border-radius": "3px",
            "background-color": "#2f5fa8",
            "width": "=if(Number(@currentField) < 0, 0, if(Number(@currentField) > 100, 100, Number(@currentField))) + '%'"
          }
        },
        {
          "elmType": "div",
          "style": {
            "position": "absolute",
            "top": "0",
            "left": "80%",
            "width": "3px",
            "height": "100%",
            "background-color": "#1f4480"
          }
        }
      ]
    },
    {
      "elmType": "span",
      "txtContent": "@currentField",
      "style": {
        "margin-left": "8px",
        "font-size": "13px",
        "font-weight": "700",
        "color": "#132a4f"
      }
    }
  ]
}
What is the Target vs Actual Bar built with?

It is built with a standard Microsoft List (SharePoint list) and a small piece of column-formatting JSON. There is no custom development, no SPFx solution, and no third-party tools. It is the kind of clean, maintainable formatting Greg Zelfond builds for teams that want a metric column that shows attainment against a goal without ongoing development overhead.

What columns does it need?

It needs one Number column on a 0 to 100 scale, where the JSON is applied, plus any label column such as the metric name. The bands and target live in the JSON rather than in a column, so no extra column is required to show the goal.

Does this design use any custom development or third-party tools?

No. It uses only out-of-the-box SharePoint column formatting, which Microsoft supports natively. That keeps it stable and easy to maintain, and nothing breaks when SharePoint is updated. Out-of-the-box is the only way Greg builds, so you can own and extend the design yourself for years.

If LookBook 365 is code-free and out-of-the-box, why does this example include JSON?

Because SharePoint formatting JSON is not custom code – it is a native configuration feature built into lists and libraries. It is declarative: it only describes how an existing column looks, and cannot run scripts, reach external services, or change your data. Nothing is deployed and nothing breaks when Microsoft updates SharePoint, and you can edit or remove it anytime. That is why LookBook 365 treats it as out-of-the-box and low risk.

Can I move the bands or the target?

Yes. The three band widths and the target tick are values in the JSON, set here to poor, ok, and good with a target at 80 percent. Change those numbers to match how your team scores the metric, and the bar and marker follow automatically.

Can Greg build a design like this for our lists?

Yes – this is exactly the kind of work Greg Zelfond does. As an independent SharePoint consultant and Microsoft MVP, he designs out-of-the-box list and library formatting like this so your team can read and maintain it without a developer. Reach out through the contact page to talk about your lists.