Rules / Report Design

Data visual with no fields

warning VISUAL_WITHOUT_FIELDS · built in · report layer · scope: Visual

What it checks

Data visuals with no field in any of their wells. Every visual type counts as a data visual, custom visuals included, except visual groups and the types that need no fields by design, such as shapes, text boxes, images, and buttons.

Each finding names the visual, as cardVisual (3d9c80) on "Overview", or as "Sales by region" on "Overview" when it has a title, at the visualType line of its visual.json, and its detail reads no fields bound.

The types that are never reported are shapes (shape, and the older basicShape), text boxes (textbox), images (image), buttons (actionButton), the page and bookmark navigators (pageNavigator, bookmarkNavigator), the Q&A visual (qnaVisual), the narrative visual (aiNarratives), the metrics scorecard visual (scorecard), and the animated number visual (animatedNumber), none of which has a well to fill. Two more have wells whose fields are optional, so they are not reported either: the paginated report visual (rdlVisual), which can use the paginated report's default parameters in place of fields when the report has them, and the Power Automate visual (FlowVisual_C29F1DCC_81F5_4973_94AD_0517D44CC06A), whose fields serve only as optional inputs to its flow.

Example

Fires the rule in visual.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.8.0/schema.json",
  "name": "3d9c80144abca427957c",
  "position": { "x": 40, "y": 90, "z": 1000, "height": 105, "width": 150, "tabOrder": 1000 },
  "visual": {
    "visualType": "cardVisual"
  }
}
After the fix in visual.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.8.0/schema.json",
  "name": "3d9c80144abca427957c",
  "position": { "x": 40, "y": 90, "z": 1000, "height": 105, "width": 150, "tabOrder": 1000 },
  "visual": {
    "visualType": "cardVisual",
    "query": {
      "queryState": {
        "Data": {
          "projections": [
            {
              "field": { "Measure": { "Expression": { "SourceRef": { "Entity": "Sales" } }, "Property": "Total Sales" } },
              "queryRef": "Sales.Total Sales"
            }
          ]
        }
      }
    }
  }
}

The card was placed on the page and never given a field, so its file has no query at all and the finding reads cardVisual (3d9c80) on "Overview" with no fields bound. The fix puts Total Sales in the card's Data well.

Why it matters

Microsoft's guidance divides what sits on a report page into visuals, which are visualizations of the model's data, and elements, which provide visual interest but don't use that data: text boxes, buttons, shapes, and images. A visual shows the fields in its wells, so a chart, card, table, or slicer with none has no data to show. Readers get a visual that shows no data, perhaps under a title or a border that suggests it should, and the next author gets a visual whose purpose nobody wrote down. Usually it is a visual that was added and never finished, or one left in place after its fields were removed.

How to fix it

Decide what the visual was meant to show. In Power BI Desktop, select it and drag those fields from the Data pane into its wells in the Visualizations pane; the wells depend on the visual's type, such as the X-axis area of a column chart, or the Bubble size and Legend areas of a map. If the page does not need the visual, delete it.

In visual.json, a visual's fields are the projections under query.queryState, one entry per field, grouped under the name of the data role behind the well, as Data for the card in the example. Role names differ from one visual type to the next and are not always the labels the Visualizations pane shows, so adding fields in Desktop is the surer route.

When to ignore it

A custom visual, or a visual type newer than pbiplint, that takes no fields, such as a custom visual that only draws a logo or a menu, is not a data visual, but pbiplint cannot tell that from the file and counts it as one. Check the Visualizations pane with the visual selected: if it offers no wells to fill, ignore the finding on it.

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

Quirks

Check a report for this Improve this page