Rules / Error Prevention

Field the model does not have

error BROKEN_FIELD_REFERENCE · built in · 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

A visual that names a field the model does not have cannot show its data. Power BI Desktop draws an error on the visual, with a warning naming the fields that do not exist, and conditional formatting that names a missing field puts a warning on the visual and in the Format pane. The error sits on that visual alone, so nothing points at the break until someone looks at it. The cause can be on the model side, a field deleted from the model or renamed after the report was built, as Microsoft's documentation describes, and a visual pasted from a report built on a different model breaks the same way. Catching it before the report is published spares readers a visual that shows an error where its numbers should be.

How to fix it

In Power BI Desktop, select the visual that the finding names; it shows an error that names the fields it cannot find. In the Visualizations pane, remove the broken field from its well and add the field you meant from the Data pane. For a field used in conditional formatting, open the formatting option's fx dialog and pick a valid field, or remove the formatting and apply it again with the right one. For a filter, remove the broken card from the Filters pane and add the field again. For a bookmark, fix the page it shows first, then select the bookmark and choose Update from its More options menu, so it captures the page again.

In the report's JSON, a field reference names its table in Entity and its column or measure in Property, as in the example: correct the name, or, for a measure that moved, the table, and change the queryRef and nativeQueryRef beside it to match. When the model is what changed and the report is right, renaming the field back in the model fixes every reference to it at once.

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 model for this Improve this page