match_slicer_layout
Learn slicer row structure from reference pages, then re-lay slicers on target pages to the inferred layout, persisting changes to the .pbix file.
Instructions
Learn the slicer ROW STRUCTURE (row count, per-row y, height, left start, horizontal gap) from hand-fixed REFERENCE pages, then re-lay the slicers on TARGET pages onto that structure. Median-based inference tolerates reference noise (a slicer nudged off-canvas, a top row whose y drifts a few px between pages) - structure is INFERRED, never copied pixel-for-pixel. Slicers only: non-slicer visuals are never touched; widths are preserved (they shrink proportionally only when a row physically cannot fit the canvas). Writes the .pbix back offline (Report/Layout patched, DataModel byte-preserved). The .pbix must NOT be open in Power BI Desktop. Returns { ok, learned{referencePages,rows:[{row,y,height,leftStart,gap,samples}],rowPitch}, pagesMatched, totalMoves, pages:[{page,rowsDetected,moves:[{slicer,row,before,after}]}], persistedToDisk }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pbix | Yes | absolute path to the .pbix (must be CLOSED in Power BI Desktop) | |
| targets | No | comma-separated TARGET pages to re-lay; omit (or 'all') for every OTHER slicer-bearing page | |
| reference_pages | Yes | comma-separated REFERENCE pages to learn from: ordinals (e.g. '0,1,2,3') and/or page names/displayNames |