pbix-mcp
v0.9.154MCP server for creating, reading, writing, and evaluating Power BI .pbix/.pbit files — no Power BI Desktop required
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
pbix_open
Open a PBIX or PBIT file for editing. Args: file_path: Full path to the .pbix or .pbit file alias: Short name to reference this file (auto-generated if empty)
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
alias | string |
pbix_save
Save/repack the modified PBIX/PBIT file. Creates an automatic .bak backup before overwriting (unless backup=False). Set overwrite=False to refuse overwriting an existing file. Args: alias: The alias of the open file output_path: Where to save. Empty = overwrite original. overwrite: If False (default), refuse to overwrite an existing file backup: If True (default), create a .bak backup before overwriting strip_sensitivity_label: If True, remove MSIP sensitivity labels from the file
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
backup | boolean | |
output_path | string | |
overwrite | boolean | |
strip_sensitivity_label | boolean |
pbix_close
Close an open file and clean up temporary files. Refuses to close files with unsaved changes unless force=True. Args: alias: The alias of the open file force: If False (default), refuse to close files with unsaved changes
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
force | boolean |
pbix_report_format
Report which layout format the open file uses, and whether it is writable. Two formats exist in the wild: * **classic** — a single ``Report/Layout`` document. Fully readable AND writable by every layout tool. * **PBIR** — a ``Report/definition/`` tree of per-page / per-visual JSON. This is what every report authored in the Power BI SERVICE downloads as. pbix-mcp reads AND writes it: the tree is converted to the classic shape for reading, and an edit is patched back onto the original page/visual files, so fields this converter doesn't model surviv…
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_list_open
List all currently open PBIX/PBIT files.
pbix_get_pages
List all pages in the report with visual counts. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_get_page_visuals
List all visuals on a specific page. Args: alias: The alias of the open file page_index: Zero-based page index
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index | integer |
pbix_get_visual_detail
Get the full configuration JSON for a specific visual. Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the page
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
visual_index * | integer |
pbix_set_visual_property
Set a property on a visual using a dot-path (e.g. 'singleVisual.title.text'). Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the page property_path: Dot-separated path into the config JSON value: New value (JSON-encoded string, e.g. '"hello"' or '42' or 'true')
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
property_path * | string | |
value * | string | |
visual_index * | integer |
pbix_update_visual_json
Replace the entire config JSON for a visual. Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the page config_json: Complete config JSON string to replace
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
config_json * | string | |
page_index * | integer | |
visual_index * | integer |
pbix_add_page
Add a new blank page to the report. Args: alias: The alias of the open file display_name: Name for the new page width: Page width in pixels (default 1280) height: Page height in pixels (default 720)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
display_name * | string | |
height | integer | |
width | integer |
pbix_remove_page
Remove a page from the report. Args: alias: The alias of the open file page_index: Zero-based page index to remove
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer |
pbix_rename_page
Rename a report page. Args: alias: The alias of the open file page: Page index (e.g. "0") or current displayName new_name: New display name for the page
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
new_name * | string | |
page * | string |
pbix_reorder_pages
Reorder the report's pages. Args: alias: The alias of the open file page_order: Comma-separated page references (indices or displayNames) in the desired order, e.g. "Summary,Detail,0". Pages left out keep their relative order after the ones listed.
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_order * | string |
pbix_set_page_visibility
Show or hide a report page (hidden pages are not shown in view mode). Args: alias: The alias of the open file page: Page index or displayName hidden: True to hide the page, False to show it
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
hidden * | boolean | |
page * | string |
pbix_duplicate_page
Duplicate a page and all of its visuals. Args: alias: The alias of the open file page: Page index or displayName to copy new_name: Display name for the copy (default: "<name> (copy)")
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page * | string | |
new_name | string |
pbix_move_visual
Move and/or resize an existing visual. Position lives on the visual CONTAINER, not in its config JSON, so pbix_set_visual_property cannot reach it. Args: alias: The alias of the open file page: Page index or displayName visual_index: Zero-based visual index on that page x: New left position in px (-1 = leave unchanged) y: New top position in px (-1 = leave unchanged) width: New width in px (-1 = leave unchanged) height: New height in px (-1 = leave unchanged) z: New z-order (-1 = leave unchanged)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page * | string | |
visual_index * | integer | |
height | number | |
width | number | |
x | number | |
y | number | |
z | number |
pbix_duplicate_visual
Copy a visual, onto the same page or another one. Args: alias: The alias of the open file page: Source page index or displayName visual_index: Zero-based visual index on the source page target_page: Destination page (default: same page) offset_x: Horizontal offset for the copy, px (same-page copies only) offset_y: Vertical offset for the copy, px (same-page copies only)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page * | string | |
visual_index * | integer | |
offset_x | number | |
offset_y | number | |
target_page | string |
pbix_create
Create a new PBIX file and open it for editing. Builds a valid PBIX entirely from scratch — no templates or skeletons. Every layer is generated from code: PBIX ZIP shell, ABF binary container, db.xml, metadata SQLite, VertiPaq column data, and report layout. Args: file_path: Where to save the new file (e.g. "my_report.pbix") alias: Alias for the opened file (auto-generated if empty) tables_json: Optional JSON array of tables with columns and rows, e.g. '[{"name": "Sales", "columns": [{"name": "Amount", "data_type": "Double"},…
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
alias | string | |
measures_json | string | |
relationships_json | string | |
tables_json | string |
pbix_add_visual
Add a new visual to a report page. Supports all Power BI visual types: card, table, clusteredBarChart, clusteredColumnChart, lineChart, pieChart, donutChart, shape (buttons), image, slicer, textbox, and any custom visual type. Args: alias: The alias of the open file page_index: Zero-based page index visual_type: Visual type (e.g. "card", "clusteredBarChart", "shape", "image", "textbox") x: X position in pixels y: Y position in pixels width: Width in pixels height: Height in pixels config_json: Optional full confi…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
visual_type * | string | |
config_json | string | |
height | integer | |
sort_by | string | |
sort_direction | string | |
width | integer | |
x | integer | |
y | integer |
pbix_set_visual_sort
Set (or clear) the visual-level sort on an existing data visual. Authors the Desktop-style ``prototypeQuery.OrderBy`` clause and recompiles the visual's query/dataTransforms binding so the compiled query carries the same clause. Without an OrderBy, the Power BI service falls back to category-ascending query order — Desktop's usual value-descending bar/ column default comes from Desktop AUTHORING an OrderBy, not the renderer. Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
visual_index * | integer | |
sort_by | string | |
sort_direction | string |
pbix_bind_field_parameter
Bind a field parameter into a visual's field well (real field-swapping). Putting the parameter's display column straight into a projection does NOT work: Desktop silently treats it as ordinary text and degrades the well to an implicit Count -- plausible-looking bars, wrong semantics, no error. The working shape (diffed against a Desktop-authored binding) keeps the currently-RESOLVED field in the projection and expresses the parameter linkage separately. This tool authors all five pieces: 1. ``projections.<role>`` holds the resolved field's queryRef, with the…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
parameter_name * | string | |
role * | string | |
visual_index * | integer | |
initial_field | string |
pbix_format_visual
Format a visual with human-readable properties (colors, titles, fonts). Converts simple formatting options to PBI's internal objects structure. Merges with existing formatting — only specified properties are changed. Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the page format_json: JSON object with formatting options. Supported keys: title: {text, show, fontSize, color | fontColor, fontFamily, bold, italic, alignment} subtitle: {text, s…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
format_json * | string | |
page_index * | integer | |
visual_index * | integer |
pbix_remove_visual
Remove a visual from a report page. Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the page
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
visual_index * | integer |
pbix_get_layout_raw
Get the raw Report/Layout JSON. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_layout_raw
Write raw layout JSON back to Report/Layout. Args: alias: The alias of the open file layout_json: Complete layout JSON string
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
layout_json * | string |
pbix_get_filters
Get report-level or page-level filters. Args: alias: The alias of the open file page_index: Page index for page filters, or -1 for report-level filters
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index | integer |
pbix_set_filters
Set report-level or page-level filters. Args: alias: The alias of the open file filters_json: JSON array of filter definitions page_index: Page index for page filters, or -1 for report-level filters
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
filters_json * | string | |
page_index | integer |
pbix_get_settings
Get report settings. Reads ``Report/definition/report.json`` ``settings`` on a PBIR report and the legacy ``Report/Settings`` part on a classic one — the authoritative location differs by format, and reading the classic part on a PBIR file reports "no settings" for a report that has them. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_settings
Write report settings. Writes ``Report/definition/report.json`` ``settings`` on a PBIR report and the legacy ``Report/Settings`` part on a classic one. Writing the classic part into a PBIR report created a second, conflicting settings document that Power BI ignores while the real one stayed stale. Args: alias: The alias of the open file settings_json: Complete settings JSON string
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
settings_json * | string |
pbix_get_bookmarks
Get report bookmarks, with the internal name beside the display name. An action button's bookmark action references the INTERNAL name (``vcObjects.visualLink[0].properties.bookmark``), and display names are not unique, so both are listed and returned in ``data``. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_add_bookmark
Create a report bookmark that captures page and visual state. Returns the bookmark's INTERNAL name in ``data.name`` (e.g. "Bookmark46feb78c853946feae45"). That is what an action button's bookmark action must reference — not the display name. Args: alias: The alias of the open file display_name: Name for the bookmark (e.g. "Sales Overview", "Q4 Filter") target_page: Optional page displayName or index to navigate to when bookmark is applied. If empty, bookmark targets the first page. hidden_visuals: Optional comma-separated…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
display_name * | string | |
capture_visual_state | boolean | |
clear_selections | boolean | |
hidden_visuals | string | |
report_filter_json | string | |
target_page | string |
pbix_remove_bookmark
Remove a bookmark by index. Args: alias: The alias of the open file bookmark_index: Zero-based index of the bookmark to remove (from pbix_get_bookmarks)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
bookmark_index * | integer |
pbix_get_metadata
Get file metadata — component inventory and sizes. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_list_resources
List all static resources (images, custom visuals, themes). Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_register_resource
Register a file resource (image, shape map, theme) in the report. Writes the bytes to ``Report/StaticResources/RegisteredResources/``, declares the extension in ``[Content_Types].xml``, and adds the item to the layout's ``resourcePackages`` — the three touchpoints Power BI Desktop uses. Returns the final item name; point an image visual at it with pbix_set_image (or use pbix_add_image, which registers AND places in one call). The file TYPE comes from the CONTENT, never from the name or a caller's claim: images (type 100) must be PNG/JPEG/GIF/WebP/BMP/TIFF/IC…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
name * | string | |
image_base64 | string | |
image_path | string | |
resource_type | string |
pbix_format_page
Format a report PAGE — canvas background and wallpaper. The page-level counterpart of pbix_format_visual. A page could not be given a background colour or a wallpaper image at all, so every converted report landed on a plain white canvas (issue #57). Args: alias: The alias of the open file page_index: Zero-based page index format_json: JSON object with any of: background: the CANVAS background — {color, transparency, image_path | image_base64, scaling, name} wallpaper: the area around the canvas (Power BI's…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
format_json * | string | |
page_index * | integer |
pbix_add_image
Add an image visual to a page — registration + placement in one call. Registers the bytes as a report resource (see pbix_register_resource) and adds a visual container matching Desktop's own image insert field-for-field (verified against Desktop-authored corpus reports): ``howCreated``, 1000-step ``z`` / ``tabOrder``, ``layouts[0].position``, ``drillFilterOtherVisuals``, the ``ImageUrl`` ResourcePackageItem expr, ``objects.imageScaling``, and ``vcObjects.padding`` 0D on all four sides. Args: alias: The alias of the open file page_index: Zero-base…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
height | integer | |
image_base64 | string | |
image_path | string | |
name | string | |
page_index | integer | |
scaling | string | |
width | integer | |
x | integer | |
y | integer |
pbix_set_image
Repoint or restyle an EXISTING image visual. Supply new bytes (image_path / image_base64) to register a fresh resource and point the visual at it, and/or ``item_name`` to point at an already-registered item, and/or ``scaling`` to change the fit. The previously referenced resource is left in place — another visual may reference the same item. Args: alias: The alias of the open file page_index: Zero-based page index visual_index: Zero-based visual index on the page (must be an image visual) image_path: New local image file (optional)…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index * | integer | |
visual_index * | integer | |
image_base64 | string | |
image_path | string | |
item_name | string | |
name | string | |
scaling | string |
pbix_add_custom_visual
Import a custom visual (.pbiviz) into the report. Extracts the .pbiviz package verbatim into ``Report/CustomVisuals/<guid>/`` and registers its GUID in the layout's ``publicCustomVisuals`` — exactly how Power BI Desktop embeds a custom visual. The GUID is read from the .pbiviz manifest (never fabricated). After importing, place it with pbix_add_visual using the returned GUID as ``visual_type`` (or use pbix_add_html_visual for the bundled PBIX HTML visual, which does everything in one call). Args: alias: The alias of the open file pbiviz_path: Abs…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
pbiviz_path * | string |
pbix_reference_public_visual
Reference a public (AppSource) custom visual by GUID — no file payload. Certified AppSource visuals (e.g. Deneb, GUID ``deneb7E15AEF80B9E4D4F8E12924291ECE89A``) are resolved by the Power BI service FROM APPSOURCE for report consumers — referencing one needs only its GUID in the layout's top-level ``publicCustomVisuals`` array. Unlike pbix_add_custom_visual, NOTHING is extracted into ``Report/CustomVisuals/`` and no .pbiviz is required: zero file parts, zero [Content_Types].xml changes, resourcePackages untouched (service-verified against app.powerbi.com on…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
guid * | string |
pbix_remove_custom_visual
Remove a custom visual package from the report. Args: alias: The alias of the open file visual_name: Name of the custom visual (from pbix_list_resources)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
visual_name * | string |
pbix_add_html_visual
Create a custom HTML / CSS / SVG visual on a report page (turnkey). The one-call path to a fully-rendered custom visual: it (1) embeds the bundled "PBIX HTML" custom visual (or your own ``pbiviz_path``), (2) authors a DAX measure whose string value IS the HTML, and (3) places a fully data-bound visual container that renders it. Power BI Desktop renders arbitrary HTML + inline ``<style>`` CSS + inline ``<svg>`` + inline ``<script>`` inside its sandboxed visual iframe — build KPI cards, SVG charts / gauges / maps, badges, custom tables, etc. External URLs are block…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
category_field | string | |
css | string | |
dax | string | |
height | number | |
html | string | |
measure_name | string | |
measure_table | string | |
page_index | integer | |
pbiviz_path | string | |
template | string | |
template_spec_json | string | |
width | number | |
x | number | |
y | number |
pbix_get_html_visual
List the HTML custom visuals in the report and their content. Returns each PBIX HTML visual with its page/visual index, position, the DAX measure that feeds it (table + name), the raw measure expression, and — when the measure is a plain HTML literal — the decoded HTML string. Args: alias: The alias of the open file page_index: Restrict to one zero-based page (default -1 = all pages)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index | integer |
pbix_set_html_visual
Edit an existing HTML custom visual's content (updates its DAX measure). Locate the visual either by ``page_index`` + ``visual_index`` (as reported by pbix_get_html_visual), or by the ``measure_name`` it is bound to. Provide the new content as EITHER ``html`` (raw string, escaped for you) OR ``dax`` (full DAX string expression). The visual container itself is untouched — only the measure's expression changes, so position/size/binding are preserved. Args: alias: The alias of the open file page_index: Page of the target visual (used with ``visual_index…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
css | string | |
dax | string | |
html | string | |
measure_name | string | |
page_index | integer | |
visual_index | integer |
pbix_html_template
Render a professional, escaping-safe HTML/SVG snippet for an HTML visual. Call with no ``kind`` to list the available templates and their spec keys. Otherwise returns the ready HTML in ``data.html`` — pass it straight to ``pbix_add_html_visual(html=...)`` (or use ``pbix_add_html_visual(template=..., template_spec_json=...)`` to do both in one call). All user text is HTML-escaped. Templates: - kpi_card {title, value, subtitle?, accent?, spark?[numbers]} - bar_chart {title, items:[[label,value],...], accent?, value_suffix?} - gauge {title, percen…
| Parameter | Type | Description |
|---|---|---|
kind | string | |
spec_json | string |
pbix_svg_measure
Generate DAX for an SVG data-URI image measure — optionally add it. Emits a DAX expression evaluating to ``data:image/svg+xml;utf8,<svg …>``. With ``DataCategory='ImageUrl'`` such a measure renders as a live vector image in table/matrix cells — in Power BI Desktop AND the service (service-verified), PDF export, and subscriptions — with zero custom visuals; the SVG recomputes under any filter context. Colors are percent-encoded (%23…), utf8 (never base64), and numeric interpolation is locale-proof. Call with no ``kind`` to list the available templates…
| Parameter | Type | Description |
|---|---|---|
alias | string | |
kind | string | |
measure_name | string | |
measure_table | string | |
spec_json | string |
pbix_get_theme
Get the current report theme JSON. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_theme
Set the report theme JSON. Writes to both BaseThemes and RegisteredResources if the theme file exists in RegisteredResources (custom themes used by the report). Args: alias: The alias of the open file theme_json: Complete theme JSON string filename: Theme filename (default: CY24SU11.json)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
theme_json * | string | |
filename | string |
pbix_extract_colors
Extract all colors from the report — theme, visuals, and page backgrounds. Scans the theme JSON and every visual's objects/vcObjects for hex color values. Also resolves ThemeDataColor references (ColorId + Percent) to their actual rendered hex values. Returns a deduplicated list with locations so you know what to change for a complete recolor. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_recolor
Global find-and-replace of colors across the entire report. Replaces hex colors in the theme (BaseThemes + RegisteredResources), the report layout (all visuals, pages, config), and page configs. Case-insensitive matching. Also converts ThemeDataColor references to direct hex Literal values when the resolved theme color is in the replacement map. This ensures ALL color references are replaced, not just hex literals. Args: alias: The alias of the open file color_map_json: JSON object mapping old hex colors to new ones, e.g. {"#0F7C7B": "…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
color_map_json * | string |
pbix_get_linguistic_schema
Get the Q&A linguistic schema XML. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_linguistic_schema
Set (replace) the Q&A linguistic schema XML. Args: alias: The alias of the open file schema_xml: The new linguistic schema XML content
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
schema_xml * | string |
pbix_get_m_code
Get the Power Query M code from the DataMashup. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_m_code
Set the Power Query M code in the DataMashup. Args: alias: The alias of the open file m_code: New M code to write into the DataMashup
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
m_code * | string |
pbix_get_model_schema
Get the data model schema — all tables, columns, and data types. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_get_model_measures
Get all DAX measures from the data model. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_get_model_relationships
Get all relationships in the data model. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_get_model_power_query
Get Power Query expressions from the model. This reads M expressions as stored in the DataModel itself (different from the DataMashup M code). Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_list_data_sources
List all data sources with connection details for each table. Parses M expressions from Partition.QueryDefinition to extract connection type, server, database, table, mode, and file paths. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_update_data_source
Update a table's data source connection without full DataModel rebuild. Changes the M expression (Partition.QueryDefinition) and optionally the mode (Import/DirectQuery). This is a lightweight metadata-only operation that does NOT regenerate VertiPaq data. Args: alias: The alias of the open file table_name: Table to update new_source_json: JSON with new connection parameters. Examples: '{"server": "new-server.example.com", "database": "prod_db"}' '{"type": "postgresql", "server": "pg.local", "port": 5432, "database": "analytics"…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
new_source_json * | string | |
table_name * | string |
pbix_set_partition_m
Set a table partition's raw Power Query M expression. The table-scoped complement to pbix_set_m_code (which replaces the whole DataMashup) and pbix_update_data_source (which builds the M from structured connection parameters): the expression is written to ``Partition.QueryDefinition`` verbatim (ledger issues-12). Metadata-only — the cached VertiPaq rows are untouched, so the file keeps opening with its current data, and Power BI runs the new M on the next Refresh. Args: alias: The alias of the open file table_name: The table whose partition to up…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
m_expression * | string | |
table_name * | string |
pbix_get_model_columns
Get all DAX calculated columns from the model. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_get_table_data
Get sample data from a table in the data model. Args: alias: The alias of the open file table_name: Name of the table to query max_rows: Maximum rows to return (default 50)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
table_name * | string | |
max_rows | integer |
pbix_export_table_csv
Export a table's data to a CSV file. Writes all rows of the table (no row limit) with headers. Strings are quoted when they contain the delimiter, quotes, or newlines. Dates are formatted as ISO 8601. Works on Import files only (not DirectQuery). Args: alias: The alias of the open file table_name: Name of the table to export output_path: Absolute path for the CSV file delimiter: Field delimiter (default ',')
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
output_path * | string | |
table_name * | string | |
delimiter | string |
pbix_export_all_tables_csv
Export every data table in the model to separate CSV files. Creates one CSV per table in the output directory. Skips system tables (H$, R$, U$, LocalDateTable, DateTableTemplate). Works on Import files only. Args: alias: The alias of the open file output_dir: Absolute path for the output directory (created if missing)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
output_dir * | string |
pbix_find_value
Search for a value across all tables and columns in the model. Returns all table.column locations where the value appears, with the number of matching rows per column. Works on Import files only. Args: alias: The alias of the open file search_value: The value to search for (string comparison) case_sensitive: If False (default), compares case-insensitively max_matches: Maximum locations to report (default 100)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
search_value * | string | |
case_sensitive | boolean | |
max_matches | integer |
pbix_query_table
Filter table rows with a SQL-like WHERE clause. Supports operators: =, !=, >, >=, <, <=, LIKE, IN. Conditions joined by AND/OR. Column values can be strings ('USA'), numbers (42), or lists for IN (('USA', 'Canada')). Args: alias: The alias of the open file table_name: Name of the table to query where: WHERE clause, e.g. "Country = 'USA' AND Amount > 1000" columns: Comma-separated columns to return (empty = all) max_rows: Maximum rows to return (default 100) order_by: Column name to sort by (optional, append ' DESC' for descendin…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
table_name * | string | |
columns | string | |
max_rows | integer | |
order_by | string | |
where | string |
pbix_table_stats
Profile a table — per-column stats (min/max/avg/distinct/nulls). For strings: distinct count, null count, min/max length, top 5 values. For numbers: min/max/avg/sum/null count. For dates: min/max/null count. Args: alias: The alias of the open file table_name: Name of the table to profile
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
table_name * | string |
pbix_data_diff
Diff row data between the same table in two PBIX files. Matches rows by key_columns (comma-separated), then reports: - Added rows (in B, not in A) - Removed rows (in A, not in B) - Changed rows (same key, different values) Args: alias_a: Alias of the first (old) file alias_b: Alias of the second (new) file table_name: Table to diff (must exist in both files) key_columns: Comma-separated columns to match rows by
| Parameter | Type | Description |
|---|---|---|
alias_a * | string | |
alias_b * | string | |
key_columns * | string | |
table_name * | string |
pbix_replace_value
Find and replace ALL occurrences of a value in a column. Reads the table, replaces all rows where the column matches old_value, and writes the updated data back via DataModel rebuild. LIMITATION: Uses the full rebuild pipeline — works on builder-created files but may break PBI Desktop files with SQL Server imports (destroys M expressions). For PBI Desktop files, use with caution. Args: alias: The alias of the open file table_name: Name of the table column_name: Name of the column to modify old_value: Value to find (exact match)…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
column_name * | string | |
new_value * | string | |
old_value * | string | |
table_name * | string | |
case_sensitive | boolean |
pbix_set_table_data
Write/replace actual row data in a table in the DataModel (VertiPaq). This encodes the data into VertiPaq column format (IDF + IDFMETA + dictionary + HIDX) and rebuilds the ABF with the new column files. The DataModel is then XPress9 recompressed. Args: alias: The alias of the open file table_name: Name of the table to write data to data_json: JSON object with 'columns' and 'rows': { "columns": [ {"name": "Col1", "data_type": "String", "nullable": true}, {"name": "Col2", "data_type": "Int64", "n…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
data_json * | string | |
table_name * | string | |
source_json | string |
pbix_update_table_rows
Update row data in an existing table, inferring column types from current schema. Reads the existing column definitions from the DataModel metadata, then encodes the new rows into VertiPaq format. Args: alias: The alias of the open file table_name: Name of the existing table rows_json: JSON array of row objects, e.g. [{"Col1": "val", "Col2": 42}, ...]
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
rows_json * | string | |
table_name * | string |
pbix_append_table_rows
APPEND rows to an existing table (issue #46 — the batching load). Unlike pbix_set_table_data / pbix_update_table_rows, which REPLACE the table's rows, this reads the current rows from VertiPaq, extends them with the batch, and re-encodes — so a large load can be pushed in batches, each call freeing the previous batch on the caller's side. Column schema is inferred from the existing table (like pbix_update_table_rows); missing keys in a batch row store as NULL. Cost note: every call re-encodes the WHOLE table (VertiPaq needs the full column view), so append…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
table_name * | string | |
rows_json | string | |
rows_path | string |
pbix_list_tables
List all tables in the data model with row/column counts. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_datamodel_query_metadata
Run a read-only SQL query on the DataModel's metadata SQLite. The metadata store is a **SQLite database** (the ABF's metadata.sqlitedb with tables like [Table], [Column], Measure, Relationship, Partition), NOT an Analysis Services $SYSTEM rowset — use SQLite syntax, and quote the reserved names: ``SELECT Name FROM [Table]``. Args: alias: The alias of the open file sql_query: SQLite query to run (e.g., "SELECT Name, Expression FROM Measure")
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
sql_query * | string |
pbix_datamodel_modify_metadata
Execute a SQL DDL/DML statement on the DataModel's metadata SQLite. This allows direct manipulation of the metadata database (tables, measures, columns, relationships, etc.). The ABF is fully rebuilt. Args: alias: The alias of the open file sql_statement: SQL statement to execute (INSERT, UPDATE, DELETE, ALTER, etc.)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
sql_statement * | string |
pbix_datamodel_modify_measure
Modify a DAX measure's expression / format / data category / data type. Performs a metadata-only splice so expressions of any length are supported. Every parameter is optional — empty string means "leave unchanged", so a format-string or DataCategory change no longer forces the caller to read and re-send the current expression. At least one change must be provided. To CLEAR an existing DataCategory use pbix_datamodel_set_measure_category. Args: alias: The alias of the open file measure_name: Name of the measure to modify new_expression: N…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
measure_name * | string | |
new_data_category | string | |
new_data_type | string | |
new_expression | string | |
new_format_string | string |
pbix_datamodel_set_measure_category
Set or CLEAR a measure's DataCategory — no expression required. A metadata-only splice touching nothing but Measure.DataCategory. Empty ``data_category`` clears it (SQL NULL) — the only first-class clearing path (pbix_datamodel_modify_measure treats empty as "leave unchanged"). Common values: "ImageUrl" (cells render a data-URI string as an image), "WebUrl" (clickable link). Args: alias: The alias of the open file measure_name: Name of the measure data_category: The category to set, or empty to clear it
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
measure_name * | string | |
data_category | string |
pbix_datamodel_add_measure
Create a new DAX measure in the specified table. The ABF is fully rebuilt so measures of any size are supported. Args: alias: The alias of the open file table_name: Table to add the measure to measure_name: Name of the new measure expression: DAX expression format_string: Optional format string description: Optional description data_category: Optional DataCategory — e.g. "ImageUrl" so table/matrix cells (and the Power BI service) render the measure's ``data:image/svg+xml;utf8,...`` string as an image, o…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
expression * | string | |
measure_name * | string | |
table_name * | string | |
data_category | string | |
data_type | string | |
description | string | |
format_string | string |
pbix_datamodel_remove_measure
Delete a DAX measure from the DataModel. The ABF is fully rebuilt. Args: alias: The alias of the open file measure_name: Name of the measure to remove
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
measure_name * | string |
pbix_datamodel_add_relationship
Add a relationship between two tables. Rebuilds the DataModel. Creates a cross-table relationship with R$ index tables in VertiPaq (except many-to-many, which by design has no join index). Args: alias: The alias of the open file from_table: "From" table name — the many side for the default ManyToOne from_column: Join column in the from table to_table: "To" table name — the one side for the default ManyToOne to_column: Join column in the to table cardinality: One of "ManyToOne" (default), "OneToMany", "OneToOne", "Man…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
from_column * | string | |
from_table * | string | |
to_column * | string | |
to_table * | string | |
cardinality | string | |
cross_filter_direction | string | |
is_active | boolean |
pbix_datamodel_remove_relationship
Remove a relationship between two tables. Rebuilds the DataModel. Args: alias: The alias of the open file from_table: Fact table name (many side) from_column: Foreign key column in fact table to_table: Dimension table name (one side) to_column: Primary key column in dimension table
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
from_column * | string | |
from_table * | string | |
to_column * | string | |
to_table * | string |
pbix_datamodel_modify_relationship
Change an existing relationship in place (no remove + re-add). Every parameter is optional — empty means "leave unchanged"; at least one change must be given. Toggling ``is_active`` / ``cross_filter_direction`` is a metadata-only splice, so it also works on models the rebuild path refuses (those containing calculated tables/columns). Changing ``cardinality`` re-runs the rebuild so the R$ join indexes are regenerated to match. Args: alias: The alias of the open file from_table: "From" table of the existing relationship from_column: Join column…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
from_column * | string | |
from_table * | string | |
to_column * | string | |
to_table * | string | |
cardinality | string | |
cross_filter_direction | string | |
is_active | string |
pbix_datamodel_remove_table
Remove a table and its measures/relationships from the DataModel. Rebuilds the DataModel without the specified table. All measures hosted on the table and all relationships referencing it are also removed. Args: alias: The alias of the open file table_name: Name of the table to remove
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
table_name * | string |
pbix_datamodel_add_field_parameter
Create a field parameter — a slicer-driven column/measure switcher. Authors the COMPLETE Desktop shape (diffed against Desktop-authored ground truth): a calculated-table partition holding the ``{("Display", NAMEOF('Table'[Field]), n), ...}`` tuple set with full static VertiPaq storage, the ``ParameterMetadata`` ExtendedProperty on the hidden Fields column, the display column sorted by the hidden Order column, and the display→Fields group-by wiring — so Power BI Desktop and the service treat it as a REAL field parameter (field-swapping in visuals), not jus…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
fields_json * | string | |
parameter_name * | string |
pbix_datamodel_add_calculation_group
Create a calculation group — dynamic measure modifiers (YTD, QTD, PY, etc.). Calculation groups apply DAX transformations to any measure used in a visual. For example, a "Time Intelligence" group with items "Current", "YTD", "PY" lets users switch between time calculations via a slicer. Args: alias: The alias of the open file group_name: Name for the calculation group table (e.g. "Time Intelligence") items_json: JSON array of calculation items, e.g. '[{"name": "Current", "expression": "SELECTEDMEASURE()"}, {"name": "YTD", "e…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
group_name * | string | |
items_json * | string | |
precedence | integer |
pbix_datamodel_modify_column
Modify a column property in the DataModel metadata. Supports string, integer, and float columns. The ABF is fully rebuilt. Args: alias: The alias of the open file table_name: Name of the table containing the column column_name: Name of the column to modify property_name: Property to change (e.g., 'FormatString', 'IsHidden', 'Description') new_value: New value for the property
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
column_name * | string | |
new_value * | string | |
property_name * | string | |
table_name * | string |
pbix_set_sort_by_column
Sort one column by the values of another (e.g. "Month Name" by "Month Number"), or clear an existing sort-by. The model stores this as a column ID, so it cannot be set by name through pbix_datamodel_modify_column; this resolves the name for you and rejects the combinations the engine refuses. Args: alias: The alias of the open file table_name: Table holding both columns column_name: Column whose display order changes sort_by_column: Column supplying the order. Empty string clears the sort-by so the column sorts by it…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
column_name * | string | |
table_name * | string | |
sort_by_column | string |
pbix_get_sort_by_columns
List every column that is sorted by another column. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_datamodel_add_calculated_column
Add a DAX calculated column to a table and materialize its values. Writes a Desktop-shape calculated column (Column.Type=2 + the DAX expression) AND stores the evaluated values in VertiPaq, so the file opens with correct data and the Power BI service recomputes it on Refresh. SCOPE: only row-context expressions over the table's OWN columns are supported — e.g. ``Margin = fct[Sales] - fct[Cost]``, ``IF(t[Qty] > 0, "Yes", "No")``, ``ROUND(t[X] * 0.1, 2)``. SUPPORTED (issue #25 r23#6 — the exact surface, so you don't discover it by probing): scalar row-conte…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
column_name * | string | |
dax * | string | |
table_name * | string | |
data_type | string |
pbix_datamodel_remove_calculated_column
Remove a DAX calculated column, undoing pbix_datamodel_add_calculated_column. Drops both halves of the column: the Type=2 metadata carrying the DAX, and the materialized values in VertiPaq. Every other calculated column and calculated table in the model is re-evaluated and re-stamped, so the result is the model as it would have been had the column never been added. Only CALCULATED columns (Column.Type=2) can be removed this way. A plain data column is part of the table's source data — use pbix_set_table_data to rewrite the table without it. Refuses when ano…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
column_name * | string | |
table_name * | string |
pbix_datamodel_add_calculated_table
Add a DAX calculated table and materialize its rows. Evaluates the table expression, stores the resulting rows in VertiPaq, and stamps Desktop's calculated-table metadata (partition Type=2 carrying the DAX, data columns Type=4) so the file opens with data and Power BI recomputes the table on Refresh. SCOPE: the expression must be one this engine reproduces faithfully — e.g. ``DATATABLE(...)``, ``GENERATESERIES(1, 12, 1)``, ``DISTINCT(Sales[Cat])``, ``VALUES(Sales[Product])``, ``FILTER(Sales, Sales[Amount] > 100)``, ``TOPN(10, Sales, Sales[Amount])``, ``ADDCO…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
dax * | string | |
table_name * | string |
pbix_datamodel_decompress
Decompress the DataModel from a PBIX into raw ABF format. This decompresses the XPress9-compressed DataModel and saves the raw ABF file for inspection. The ABF contains the full VertiPaq storage engine data. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_datamodel_recompress
Recompress a modified ABF file back into the DataModel. After using pbix_datamodel_decompress to get the ABF, you can decompress and modify the ABF (or any of its internal files), call this to XPress9-compress it back into the DataModel. The next pbix_save will include the updated DataModel. Workflow: 1. pbix_datamodel_decompress(alias) -> saves .abf 2. Modify the .abf (directly, or via modify_measure / modify_metadata) 3. pbix_datamodel_recompress(alias) -> compresses .abf back into DataModel Args: alias: The alias of the open file…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
abf_path | string |
pbix_datamodel_replace_file
Replace a specific file inside the ABF (decompressed DataModel). This lets you swap out any internal ABF file — for example, replace metadata.sqlitedb with a modified version. Files can be ANY size — the ABF is fully rebuilt with updated offsets and headers. Args: alias: The alias of the open file internal_path: Partial path to match inside the ABF (e.g. 'metadata.sqlitedb') new_content_path: Path to the replacement file on disk
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
internal_path * | string | |
new_content_path * | string |
pbix_datamodel_extract_file
Extract a specific file from inside the ABF (decompressed DataModel). Args: alias: The alias of the open file internal_path: Partial path to match inside the ABF (e.g. 'metadata.sqlitedb') output_path: Where to save the extracted file. Default: next to DataModel.
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
internal_path * | string | |
output_path | string |
pbix_datamodel_list_abf_files
List all files inside the ABF (decompressed DataModel). Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_evaluate_dax
Evaluate one or more DAX measures against the data model. Uses the built-in DAX engine to compute measure values, supporting: SUM, AVERAGE, DIVIDE, IF, CALCULATE, DATEADD, REMOVEFILTERS, ALL, MAXX, SUMX, VAR/RETURN, and 25+ other DAX functions. Supports relationship-based filter propagation (star-schema joins). Args: alias: The alias of the open file measures: Comma-separated measure names to evaluate, e.g. "Sales,Profit Margin,Sales LY" filter_context: Optional JSON filter context, e.g. '{"dim-Date.Year": [2015]}'. A non-empty filter_…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
measures * | string | |
apply_default_filters | boolean | |
filter_context | string | |
group_by | string | |
page_index | integer | |
selected_filter_context | string |
pbix_evaluate_dax_batch
Answer pbix_evaluate_dax for a whole list of filter contexts at once. Meant for clients that query a visual row by row (a running total over dates asks one context per date): rather than one tool call per row, send the rows' contexts together. The open file, its model and the measure list are resolved a single time, and every context draws on one measure memo, so a value that does not depend on the row -- the per-item totals a RANKX ranks, an ALL(...) denominator -- is computed for the first context and reused by the rest (issue #233). The memo is restarted whe…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
contexts * | string | |
measures * | string | |
max_contexts | integer |
pbix_evaluate_dax_per_dimension
Evaluate DAX measures for each value of a dimension (e.g., Sales per State). Iterates over unique values of a dimension column and evaluates measures with that dimension value as a filter. Uses relationship-based propagation. Args: alias: The alias of the open file measures: Comma-separated measure names, e.g. "Sales,Sales LY,Sales change" dimension: Table.Column to iterate over, e.g. "dim-Geo.State" filter_context: Optional JSON base filter, e.g. '{"dim-Date.Year": [2015]}'. A non-empty filter_context always wins (defaults are not merg…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
dimension * | string | |
measures * | string | |
apply_default_filters | boolean | |
filter_context | string | |
max_values | integer | |
page_index | integer |
pbix_evaluate_dax_grouped
Evaluate measures for every group key in ONE call, returning STRUCTURED rows. The GROUP-BY entry point for chart-shaped work: instead of a separate evaluation per category value (O(distinct values) round-trips), the fact rows are bucketed by the propagated join key once and each bucket is aggregated — so a chart bound to thousands of categories costs a single call. Results come back as machine-readable data (one object per group), not a formatted table, so a client can bind them directly. Measures the fast path can't bucket (anything that isn't a simple aggr…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
group_by * | string | |
measures * | string | |
apply_default_filters | boolean | |
filter_context | string | |
max_groups | integer | |
order | string | |
order_by | string | |
page_index | integer | |
top_n | integer |
pbix_get_default_filters
Extract default slicer filter selections from a report page. Reads the filter config from slicer visuals (slicer, advancedSlicerVisual, listSlicer) to determine what the dashboard's default filtered state is. Supports both In-type (value list) and Comparison-type (equality/range) filters: a range comes back as a predicate such as ``{"op": ">=", "value": "2024-01-01T00:00:00"}`` (both bounds of a Between slicer as ``{"all": [...]}``), which pbix_evaluate_dax's filter_context takes as it is. Args: alias: The alias of the open file page_index: Zer…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index | integer |
pbix_get_visual_positions
Get all visual positions with parent group offset resolution. For visuals inside groups, the raw x/y coordinates are relative to the parent group. This tool resolves them to absolute page coordinates. Args: alias: The alias of the open file page_index: Zero-based page index
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
page_index | integer |
pbix_clear_dax_cache
Clear the DAX engine data cache. Call this after modifying measures or table data to force fresh evaluation. Args: alias: Clear cache for specific alias, or all if empty
| Parameter | Type | Description |
|---|---|---|
alias | string |
pbix_evaluate_calculated_columns
Evaluate all calculated columns in the data model. Finds columns with DAX expressions in the metadata, evaluates them per-row against actual table data, and adds the results to the cached data context. This is useful when calculated columns were defined but their values aren't materialized in VertiPaq. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_get_rls_roles
Get all Row-Level Security roles and their table filter expressions. Returns role definitions and the DAX filter expressions that define what data each role can see. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_rls_role
Create or update a Row-Level Security role with a DAX filter expression. The filter expression is a DAX boolean expression that determines which rows are visible to the role. For example: 'dim-Geo'[Country] = "USA" 'Sales'[Amount] > 1000 Args: alias: The alias of the open file role_name: Name of the RLS role (e.g., "US Sales Only") table_name: Table to apply the filter to filter_expression: DAX filter expression (e.g., 'Sales'[Region] = "West") description: Optional role description
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
filter_expression * | string | |
role_name * | string | |
table_name * | string | |
description | string |
pbix_evaluate_rls
Evaluate an RLS role's filter and show which rows would be visible. Uses the DAX engine to evaluate the role's filter expression against actual table data. Args: alias: The alias of the open file role_name: Name of the RLS role to evaluate table_name: Table to check visibility for max_rows: Maximum rows to show (default 10)
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
role_name * | string | |
table_name * | string | |
max_rows | integer |
pbix_get_perspectives
Get all perspectives with their included tables, columns, and measures. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_add_perspective
Add a perspective — a filtered view of the model for different user groups. Args: alias: The alias of the open file name: Name for the perspective (e.g. "Sales Analyst", "Executive View") tables_json: JSON array of tables to include, e.g. '[{"table": "Sales"}, {"table": "Product", "columns": ["Name", "Category"]}]' If columns/measures are omitted for a table, all are included. Optional per-table fields: "columns" (list), "measures" (list) description: Optional description
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
name * | string | |
description | string | |
tables_json | string |
pbix_remove_perspective
Remove a perspective and all its included table/column/measure references. Args: alias: The alias of the open file name: Name of the perspective to remove
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
name * | string |
pbix_get_hierarchies
Get all user hierarchies with their levels and columns. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_add_hierarchy
Create a user hierarchy (drill-down path) on a table. Args: alias: The alias of the open file table_name: Table to add the hierarchy to hierarchy_name: Name for the hierarchy (e.g. "Geography", "Date Hierarchy") levels_json: JSON array of levels in drill-down order, e.g. '[{"name": "Country", "column": "Country"}, {"name": "State", "column": "State-Province"}, {"name": "City", "column": "City"}]'
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
hierarchy_name * | string | |
levels_json * | string | |
table_name * | string |
pbix_remove_hierarchy
Remove a user hierarchy and all its levels. Args: alias: The alias of the open file table_name: Table the hierarchy belongs to hierarchy_name: Name of the hierarchy to remove
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
hierarchy_name * | string | |
table_name * | string |
pbix_get_cultures
Get all cultures (languages) with translation counts. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_model_culture
Set the MODEL's own culture (Model.Culture / SourceQueryCulture). This is not a translation culture. It is the culture FORMAT() resolves its separators from and the model collates by, so it is what decides whether ``FORMAT(1477000, "#,##0.00")`` renders 1,477,000.00 or 1.477.000,00. Use ``pbix_add_culture`` for translations. Args: alias: The alias of the open file culture_name: BCP-47 culture code (e.g. "pt-BR", "nb-NO", "de-DE")
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
culture_name * | string |
pbix_add_culture
Add a culture (language) for translations. Args: alias: The alias of the open file culture_name: BCP-47 culture code (e.g. "nb-NO", "de-DE", "fr-FR", "ja-JP")
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
culture_name * | string |
pbix_add_translations
Add translated names/descriptions for model objects in a culture. Args: alias: The alias of the open file culture_name: Target culture (e.g. "nb-NO") translations_json: JSON array of translations, e.g. '[{"object": "Sales", "type": "table", "property": "caption", "value": "Salg"}, {"object": "Sales.Amount", "type": "column", "property": "caption", "value": "Beloep"}]' type: "table", "column", "measure", "hierarchy" property: "caption" (display name), "description", "displayFolder" For columns/measures: u…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
culture_name * | string | |
translations_json * | string |
pbix_remove_culture
Remove a culture and all its translations. Args: alias: The alias of the open file culture_name: Culture code to remove (e.g. "nb-NO")
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
culture_name * | string |
pbix_get_partitions
Get all partitions with table, type, mode, and M expression. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_add_partition
Add a new M (Power Query) partition to a table. WARNING: This tool is blocked for PBIX files opened in PBI Desktop. Adding partitions requires PartitionStorage objects in VertiPaq which cannot be created via metadata-only modification. The partition metadata is written correctly but PBI Desktop will reject the file on open. Works for PBIP/TMDL export (pbix_export_pbip, pbix_export_tmdl). Args: alias: The alias of the open file table_name: Table to add the partition to partition_name: Name for the new partition expression: M (Power Query…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
expression * | string | |
partition_name * | string | |
table_name * | string | |
mode | string |
pbix_remove_partition
Remove a partition from a table. Will not delete the last remaining partition of a table. Args: alias: The alias of the open file table_name: Table the partition belongs to partition_name: Name of the partition to remove
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
partition_name * | string | |
table_name * | string |
pbix_get_password
Extract embedded passwords from a PBIX file. Scans the data model for password-like tables (tables with 'password' in the name) and DAX measures that reference them (ISFILTERED, SELECTEDVALUE). Extracts the expected password value from the DAX expression. This is useful for dashboards that use a password-slicer gate pattern where the report is locked until the correct password is entered. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_performance
Analyze report for performance issues and optimization opportunities. Checks for oversized tables, high column counts, complex measures, orphaned tables, inactive relationships, and wide schemas. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_diff
Compare two open PBIX files and show what changed. Compares tables, columns, measures, relationships, pages, visuals, data sources, and theme colors between two files. Both files must be open. Args: alias_a: The alias of the first file (baseline / "old") alias_b: The alias of the second file (changed / "new")
| Parameter | Type | Description |
|---|---|---|
alias_a * | string | |
alias_b * | string |
pbix_document
Auto-generate a comprehensive report documentation summary. Assembles all report metadata into a structured document: tables with row counts, column details, DAX measures with expressions, relationships, data sources, pages with visual inventories, RLS roles, and theme colors. Returns markdown in the response AND saves a .docx file to disk. Args: alias: The alias of the open file output_path: Where to save the .docx file. Default: next to the PBIX.
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
output_path | string |
pbix_doctor
Run comprehensive diagnostics on an open PBIX/PBIT file. Performs a full health check across every layer of the file: ZIP structure, report layout, DataModel compression, ABF archive, SQLite metadata, data source connections, storage modes, VertiPaq column data, relationships, measures, calculated tables, RLS roles, and slicer filters. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_set_incremental_refresh
Configure incremental refresh policy for a table. Incremental refresh partitions a table by date range so only recent data is refreshed, dramatically reducing refresh time for large datasets. Requires the table's M expression to filter on RangeStart/RangeEnd parameters. These DateTime parameters are automatically created if they don't exist. Args: alias: The alias of the open file table_name: Table to apply the refresh policy to archive_periods: Number of periods to keep as historical (default 36) archive_granularity: Granularity for archi…
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
table_name * | string | |
archive_granularity | string | |
archive_periods | integer | |
detect_changes_column | string | |
mode | string | |
refresh_granularity | string | |
refresh_periods | integer |
pbix_get_incremental_refresh
Get incremental refresh policies for all tables. Args: alias: The alias of the open file
| Parameter | Type | Description |
|---|---|---|
alias * | string |
pbix_export_tmdl
Export the data model as TMDL (Tabular Model Definition Language) files. TMDL is a human-readable, Git-friendly text format for Power BI models. Creates a folder with .tmdl files for tables, relationships, roles, etc. Args: alias: The alias of the open file output_path: Output directory path. Defaults to <pbix_dir>/<alias>_tmdl/
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
output_path | string |
pbix_import_tmdl
Import a TMDL model (folder or single .tmdl file) into a new PBIX. The inverse of pbix_export_tmdl: parses tables, columns (calculated included), measures, relationships, hierarchies, partitions (M/DAX sources), shared M expressions, roles, extended properties (field parameters) and lineage tags, and builds a working schema-only PBIX (TMDL carries no row data — refresh in Power BI Desktop repopulates from the partitions' M queries). Round-trip: export → import → export reproduces the same TMDL files. Args: tmdl_path: TMDL definition folder (with…
| Parameter | Type | Description |
|---|---|---|
tmdl_path * | string | |
alias | string | |
output_path | string |
pbix_open_pbip
Open a PBIP project folder (TMDL model half + report half) as a live document — the same session every other tool operates on. pbix_save (with no output_path) writes edits back into the project folder; pbix_save with a .pbix output_path converts the project to a PBIX. Args: path: The .pbip file or the project folder containing it. alias: Short name for the session (defaults to the project name).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
alias | string |
pbix_export_pbip
Convert a PBIX to PBIP (Power BI Project) folder structure. Creates a PBIP project with: - {name}.pbip (root pointer JSON) - {name}.Report/ (report layout + static resources) - {name}.SemanticModel/ (semantic model as TMDL) - .gitignore (standard PBIP ignores) PBIP is Microsoft's folder-based format for Git version control and CI/CD. Args: alias: The alias of the open file output_dir: Target directory. Defaults to <pbix_dir>/<name>_pbip/
| Parameter | Type | Description |
|---|---|---|
alias * | string | |
output_dir | string |