Rules / Error Prevention

Bookmark refers to a missing page or visual

warning BROKEN_BOOKMARK_REFERENCE · built in · report layer · scope: Bookmark

What it checks

Bookmarks whose active page, or another page they capture, is not in the report, which capture a visual that is not on its page, or which apply only to selected visuals and name one that is not on their active page, matched against the name in each page.json and visual.json.

Each finding names the bookmark by the display name its file gives it, as Bookmark "Reset", at the line in its bookmark file that names what is missing, and its detail says what that is: active page "a91c3e5f7d2b4086e1c9" does not exist, captured page "a91c3e5f7d2b4086e1c9" does not exist, captured visual "8b2e41c07d95a3f6e210" is not on page "Overview", or target visual "8b2e41c07d95a3f6e210" is not on page "Overview". A target visual is a name in options.targetVisualNames, the list of visuals a bookmark with its Selected visuals option on applies to. A bookmark's stale target visuals are one finding, at the line of the first; its detail names up to three and counts the rest: target visuals "8b2e41c07d95a3f6e210", "c4d17a9e0b3f5826e1a7", "f05b92e8a1d3c7460b9e", and 2 more are not on page "Overview".

Example

Fires the rule in Reset.bookmark.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/bookmark/1.0.0/schema.json",
  "name": "Reset",
  "displayName": "Reset",
  "explorationState": {
    "version": "1.3",
    "activeSection": "p1",
    "sections": {
      "p1": {
        "visualContainers": {
          "8b2e41c07d95a3f6e210": {
            "singleVisual": {
              "visualType": "tableEx",
              "objects": {}
            }
          }
        }
      }
    }
  },
  "options": {
    "targetVisualNames": []
  }
}
After the fix in Reset.bookmark.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/bookmark/1.0.0/schema.json",
  "name": "Reset",
  "displayName": "Reset",
  "explorationState": {
    "version": "1.3",
    "activeSection": "p1",
    "sections": {
      "p1": {
        "visualContainers": {}
      }
    }
  },
  "options": {
    "targetVisualNames": []
  }
}

The Reset bookmark captures the Overview page with the state of a table, 8b2e41c07d95a3f6e210, that is not on the page, as a bookmark file copied in from another report or merged by hand can, so the finding reads Bookmark "Reset" with captured visual "8b2e41c07d95a3f6e210" is not on page "Overview". The fix removes the table's entry from visualContainers.

Why it matters

A bookmark captures the state of a report page: Microsoft lists the current page among what a bookmark saves, with its filters and slicers, sort order, and which objects the Selection pane shows or hides. With its Current page option on, which Microsoft describes as navigating to the page that was active when the bookmark was created, a bookmark whose active page is not in the report has no page to take readers to, whether they select it in the Bookmarks pane or through a button or bookmark navigator that applies it. A captured visual that is not on its page is state kept for a visual the page does not have: whatever the bookmark was made to do to it, show it, hide it, or sort it, has nothing to act on.

With Selected visuals on, Microsoft says the bookmark "Applies the bookmark settings only to the visuals you select before creating or updating the bookmark" (Create report bookmarks (opens in a new tab)), and the file keeps those visuals by name. A name in that list that no visual on the page has is a visual the bookmark was made to act on and can no longer reach. A visual put in its place since has a name of its own, which the list does not hold, so the bookmark leaves it alone.

Microsoft's PBIR documentation, in its answer about a bookmark file copied from another report, says that Power BI Desktop removes invalid visuals from a bookmark's configuration when it saves. So a captured visual that names nothing usually means a bookmark file edited, copied, or merged outside Desktop and not saved in Desktop since. The documentation says nothing of the same for a missing page, and Power BI Desktop's saved files do keep bookmarks whose active page is gone. Power BI Desktop's saved files also keep names in the list of visuals a bookmark applies to after their visual is gone, even from a save that removed the same visual from the bookmark's captured visuals.

How to fix it

In Power BI Desktop, on the View tab, select Bookmarks to open the Bookmarks pane. Go to the page the bookmark should show, arrange its visuals as the bookmark should leave them, then select More options (...) next to the bookmark's name and choose Update. If nobody needs the bookmark any more, choose Delete from the same menu. Deleting it and adding a new one from the right page also works, but a button keeps pointing at the bookmark it was set to, not at its display name, so point any button that used the old one at the new one; BROKEN_ACTION_TARGET reports any that still name it. For a captured visual that is no longer on the page, opening the report in Desktop and saving it is enough, since Desktop removes such visuals from the bookmark when it saves. For a target visual, saving is not enough: select the visuals the bookmark should apply to, on the page or in the Selection pane (hold Ctrl to select more than one), then choose Update from the bookmark's More options (...) menu.

When to ignore it

There is no legitimate case. A bookmark that names a page or visual the report lacks keeps state for, or applies to, something that is not there, so recapture it or delete it; a bookmark nobody uses is better deleted than ignored.

This rule reports on bookmarks, and a bookmark's file has no place for an annotation, so there is no object to annotate. To turn the rule off for a whole project, set "BROKEN_BOOKMARK_REFERENCE": "off" under rules in pbiplint.config.json.

Quirks

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