agentleFS
wardawgmalviciouswardawgmalvicious/agent-config/skills/powerbi/pbir-visual-json/SKILL.md

pbir-visual-json

Skill1 starsChanged 56 days agoMITView on GitHub

Use when editing visual.json inside a Power BI PBIR report's visuals/ folder. Covers top-level structure (name, position, visual vs visualGroup mutually exclusive, filterConfig sibling NOT child of visual, root-level isHidden for bookmark toggles), expression literal suffixes — string 'text', double 14D, integer 14L, decimal 2.4M, hex '#FF0000', datetime literal, null — with exceptions (transparency uses L inside dropShadow, labelPrecision L, labelDisplayUnits D, triple-quoted font fallback chains), field reference patterns (Column, Measure, Aggregation, HierarchyLevel, SparklineData), visual-type to query-role map (card, tableEx, pivotTable, slicer, lineChart, barChart, kpi, scatterChart), objects vs visualContainerObjects split, sortDefinition, slicer default values via objects.general.properties.filter, visual groups, table column widths.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All formatting values inside visual.json use {"expr": {"Literal": {"Value": "..."}}} wrappers.

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PBIR visual.json Reference

Path: Report.Report/definition/pages/{PageName}/visuals/{VisualName}/visual.json

Top-Level Structure

PropertyTypeRequiredNotes
$schemastringyes.../visualContainer/2.7.0/schema.json
namestringyesStable visual ID — referenced by bookmarks, interactions
positionobjectyesx, y, z, width, height, tabOrder
visualobjectone ofRegular visual — mutually exclusive with visualGroup
visualGroupobjectone ofGroup container
parentGroupNamestringnoSet on children of a visualGroup
filterConfigobjectnoVisual-scoped filters — sibling of visual, NOT nested
isHiddenbooleannoRoot-level. Visual still processes data; common for bookmark toggles

position

{"x": 100, "y": 50, "z": 1000, "width": 400, "height": 300, "tabOrder": 0}

z layer order: higher = front. Common values 0, 1000, 2000, 3000, 5000, 8000, 15000.

visual Object

PropertyNotes
visualTypeSee visual type table below
query.queryStateRole → projections map
query.sortDefinitionsort[] + isDefaultSort
objectsVisual-specific formatting (axes, legend, dataPoint, labels, lineStyles)
visualContainerObjectsContainer formatting (title, subTitle, background, border, dropShadow, padding, divider, visualHeader, visualTooltip)
drillFilterOtherVisualsboolean
syncGroupSlicer cross-page sync: groupName, fieldChanges, filterChanges
expansionStatespivotTable row/column expansion

Critical: objects vs visualContainerObjects are distinct in schema 2.4.0+. Container properties in objects fail silently. visualContainerObjects at root errors.

Expression Literal Suffixes

All formatting values inside visual.json use {"expr": {"Literal": {"Value": "..."}}} wrappers. Theme JSON uses bare values.

TypeExampleNotes
String"'smooth'"Inner single quotes required
Double"14D"Font sizes, percentages, most numerics
Integer"14L"Pixel counts, enum values, labelPrecision
Decimal"2.4M"Money/decimal precision
Boolean"true"Lowercase, no quotes, no suffix
DateTime"datetime'2024-01-15T00:00:00.0000000'"Closing ' required
Hex color"'#FF0000'"Inner single quotes; 6-digit RGB or 8-digit ARGB
Null"null"Lowercase, no quotes

Non-literal expressions:

TypeShape
Theme color{"expr": {"ThemeDataColor": {"ColorId": 0, "Percent": 0}}}
Extension measure{"expr": {"Measure": {"Expression": {"SourceRef": {"Schema": "extension", "Entity": "_Formatting"}}, "Property": "Color"}}}

Gotchas: transparency uses D normally but L inside dropShadow. labelPrecision always L, labelDisplayUnits always D. String escaping: single quotes doubled ("'O''Brien'"). Font fallback chains: "'''Segoe UI Semibold'', helvetica, sans-serif'". (Yes — three single quotes. The outer pair wraps the SQExpr string literal; the inner pair escapes the space-containing font name. Not a typo.)

Field Reference Patterns

PatternShape
Column{"Column": {"Expression": {"SourceRef": {"Entity": "Table"}}, "Property": "Col"}}
Measure (model){"Measure": {"Expression": {"SourceRef": {"Entity": "Table"}}, "Property": "M"}}
Measure (extension){"Measure": {"Expression": {"SourceRef": {"Schema": "extension", "Entity": "_Fmt"}}, "Property": "M"}}
Aggregation{"Aggregation": {"Expression": {"Column": {...}}, "Function": 0}}
Hierarchy level{"HierarchyLevel": {"Expression": {"Hierarchy": {...}}, "Level": "Level"}}
SparklineData{"SparklineData": {"Measure": {...}, "Groupings": [{"Column": {...}}]}}

QueryAggregateFunction: 0=Sum, 1=Avg, 2=DistinctCount, 3=Min, 4=Max, 5=Count, 6=Median, 7=StdDev, 8=Var

Filter SourceRef gotcha: inside filter Where conditions, SourceRef uses "Source": "alias" (from From), NOT "Entity". Query projections use "Entity".

Visual Types and Query Roles

visualTypeRoles
cardValues
cardVisual (new card)Data
tableExValues
pivotTableRows, Columns, Values
slicer / advancedSlicerVisualValues
pieChart / donutChartCategory, Y
lineChartCategory, Y, Y2 (combo)
areaChart / stackedAreaChartCategory, Y, Series
barChart / clusteredBarChart / hundredPercentStackedBarChartCategory, Y
columnChart / clusteredColumnChart / hundredPercentStackedColumnChartCategory, Y
lineClusteredColumnComboChart / lineStackedColumnComboChartCategory, Y, Y2
ribbonChart / waterfallChartCategory, Y
scatterChartCategory, X, Y, Size, Tooltips
gaugeY, TargetValue
kpiIndicator, Goal, TrendLine
textboxnone (uses objects.general.paragraphs)
shape / actionButton / imagenone
scriptVisual / pythonVisualValues
PBI_CV_<GUID>varies (custom visuals)
deneb<GUID>dataset

Projection Properties

PropertyNotes
queryRefTable.Field — internal reference
nativeQueryRefDisplay label
displayNameOptional override
activeBoolean — hierarchy level expanded

Visual calculations (NativeVisualCalculation) always have queryRef: "select".

sortDefinition

"sortDefinition": {
  "sort": [{
    "field": {"Measure": {"Expression": {"SourceRef": {"Entity": "Sales"}}, "Property": "Revenue"}},
    "direction": "Descending"
  }],
  "isDefaultSort": true
}

Slicer Default Selected Values

Store in objects.general.properties.filter — NOT filterConfig. filterConfig filters data going into the slicer; objects.general.properties.filter pre-selects values.

Hiding Visuals and Fields

  • Hide whole visual: "isHidden": true at root (outside visual).
  • Hide fields from display: omit from queryState — still referenceable by extension measures / filters.

Visual Groups

{
  "name": "kpi_group",
  "position": {"x": 0, "y": 0, "z": 0, "width": 800, "height": 400},
  "visualGroup": {
    "displayName": "KPI Section",
    "groupMode": "ScaleMode",
    "objects": {"background": [...], "general": [...], "lockAspect": [...]}
  }
}

groupMode: ScaleMode (scale contents) or ScrollMode. Children set parentGroupName. Group objects limited to background, general, lockAspect.

Table / Matrix Column Widths

"columnWidth": [{
  "properties": {"value": {"expr": {"Literal": {"Value": "215D"}}}},
  "selector": {"metadata": "Orders.Order Lines"}
}]

mobile.json

Optional sibling file at visuals/{VisualName}/mobile.json. Mirrors visual.json position fields with mobile coordinates. Typically authored via Desktop.

Gotchas

IssueCauseFix
Container props silently ignoredPlaced in objects instead of visualContainerObjectsMove title/border/background/dropShadow/padding to visualContainerObjects
Root-level error on visualContainerObjectsPlaced at visual.json root instead of inside visualNest under visual (container objects still live inside visual)
filterConfig ignoredNested inside visualMust be sibling of visual at root of visual.json
Slicer default values don't stickStored in filterConfigUse objects.general.properties.filter
transparency parse error in dropShadowUsed D suffixUse L inside dropShadow
String literal unterminatedMissing closing single quote on datetime'...'Always close datetime literals with '
Filter Where condition brokenUsed SourceRef.Entity instead of SourceRef.SourceReference the alias from From[]
Font fallback chain brokenSingle-level quotesTriple-quote primary font: "'''Segoe UI Semibold'', sans-serif'"
labelPrecision rejectedUsed D suffixAlways L
labelDisplayUnits rejectedUsed L suffixAlways D
Sparkline formatting ignoredselector.metadata doesn't match projection queryRefCopy exact SparklineData(...) queryRef into selector
visual and visualGroup both presentMutually exclusivePick one per visual.json

April 2026 visual changes

VisualChangeAuthoring impact
cardVisual / slicer (button-slicer / list-slicer modes)Multicard layout exposes a Fixed size toggle (exact pixel dimensions). Mutually exclusive with Fit to space (renamed from Autogrid).Property names not yet documented as a JSON-schema keys — verify in a saved visual.json before authoring. Existing reports with Autogrid formatting will surface under Fit to space in the Format pane.
cardVisualTheme JSON keys paddingUniform (default 12) and backgroundTransparency documented under cardVisual style preset. Category headers participate in Edit interactions; Multi-category layout Autogrid capped at 4 rows (toggle off for more).When clearing legacy padding, write "paddingUniform": 0. Theme schema URL is reportThemeSchema-2.149.json.
narrativeVisual (smart narrative)Defaults to Copilot mode for users with a Copilot license. Character limit raised to 10,000.Narrative visual.json content beyond 10,000 chars should now load; treat default-mode probes carefully — un-licensed users still land in classic mode.

Reference

See also

  • pbir-themes — theme value conventions (bare vs wrapped literals)
  • pbir-conditional-formatting — CF patterns inside visual.json objects
  • pbir-filters — filter body shape and SourceRef.Source rule
  • pbir-bookmarks — bookmarks reference the visual's root-level name

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.