Rules / Error Prevention

Field the model does not have

error BROKEN_FIELD_REFERENCE · built in · project layer · scope: Visual, Page, Report, Bookmark

What it checks

References in the report to a table, column, measure, hierarchy, or hierarchy level that the model does not have, wherever the report names a field: a visual's wells, formatting, and sort, a filter on a visual, a page, or the whole report, a drillthrough or tooltip page's fields, and a bookmark.

Each finding names the object that carries the reference: a visual as "Sales by region" on "Overview", or as clusteredBarChart (5a1c3e) on "Overview" when it has no title; a page's filter as Page filter on "Overview"; the report's filter as Report filter; a drillthrough or tooltip page's field as Page "Product detail"; and a bookmark as Bookmark "Reset". Its detail names the field and says why it does not resolve, as [Profit]: no measure named "Profit" on "Sales", 'Sales'[Colour]: no column named "Colour" on "Sales", or 'Store'[City]: no table named "Store", and the finding sits on the reference's own line in the file.

Example

The example runs against a model with one table, Sales, holding Amount and Region and the measure Total Sales.

Fires the rule in visual.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.8.0/schema.json",
  "name": "5a1c3e9b27d84f06a2c1",
  "position": { "x": 40, "y": 220, "z": 2000, "height": 300, "width": 500, "tabOrder": 2000 },
  "visual": {
    "visualType": "clusteredBarChart",
    "query": {
      "queryState": {
        "Category": {
          "projections": [
            {
              "field": { "Column": { "Expression": { "SourceRef": { "Entity": "Sales" } }, "Property": "Region" } },
              "queryRef": "Sales.Region",
              "nativeQueryRef": "Region",
              "active": true
            }
          ]
        },
        "Y": {
          "projections": [
            {
              "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "Sales" } }, "Property": "Profit" } },
              "queryRef": "Sales.Profit",
              "nativeQueryRef": "Profit"
            }
          ]
        }
      }
    }
  }
}
After the fix in visual.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.8.0/schema.json",
  "name": "5a1c3e9b27d84f06a2c1",
  "position": { "x": 40, "y": 220, "z": 2000, "height": 300, "width": 500, "tabOrder": 2000 },
  "visual": {
    "visualType": "clusteredBarChart",
    "query": {
      "queryState": {
        "Category": {
          "projections": [
            {
              "field": { "Column": { "Expression": { "SourceRef": { "Entity": "Sales" } }, "Property": "Region" } },
              "queryRef": "Sales.Region",
              "nativeQueryRef": "Region",
              "active": true
            }
          ]
        },
        "Y": {
          "projections": [
            {
              "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "Sales" } }, "Property": "Total Sales" } },
              "queryRef": "Sales.Total Sales",
              "nativeQueryRef": "Total Sales"
            }
          ]
        }
      }
    }
  }
}

The chart asks the Sales table for a Profit measure it does not have, so the finding reads [Profit]: no measure named "Profit" on "Sales". The fix binds Total Sales, which the model does have, in its place.

Why it matters

In Power BI Desktop, a visual that names a missing field shows an error where its data should be. A text box whose field value names one shows "Something's wrong with one or more fields." in place of its text, with a See details link and a Fix this button. If conditional formatting names a missing field, a warning icon appears in the visual's header and in the Format pane while you edit the visual. The break can come from a field deleted or renamed in the model after the report was built. It can also come from a visual copied from a report on another model, which adds a warning about which fields do not exist. Nothing points at the break until someone looks at the broken visual, so catching it before you publish spares your readers the error.

How to fix it

In Power BI Desktop, select the visual the finding names, remove the broken field from its well in the Visualizations pane, and add the field you meant from the Data pane. Other kinds of reference have their own routes:

When to ignore it

There is no legitimate exception, because a reference the model cannot resolve is broken for every reader of the report.

To ignore this rule on one page or visual, add { "name": "pbiplint.ignore", "value": "BROKEN_FIELD_REFERENCE" } to the annotations array of its page.json or visual.json. Power BI Desktop keeps the annotation. To turn the rule off for a whole project, set "BROKEN_FIELD_REFERENCE": "off" under rules in pbiplint.config.json.

Quirks

Check a project for this Improve this page (opens in a new tab)