Visual calculations in Power BI that let you define DAX (Data Analysis Expression) calculations directly on a visual, instead of having to create a measure or calculated column in the data model, which applies to an entire page or report. They’re helpful for common “on-the-fly” calculations within a visual. For example, within a table visualisation, including running totals, moving averages, and percent of parent, among others.
Key characteristics:
- They live in the visual (not stored in the semantic model)
- They can only reference fields (columns, measures) that are part of that visual
Because of this, you can avoid dealing with more complex filter contexts or model relationships (to an extent).
Visual calculations are an advanced-level feature within Power BI. Before trying visual calculations, we recommend that you are comfortable with Power BI, creating visuals, and working with fields, and have some familiarity with DAX syntax, measures vs columns, filter context, etc
We'll cover:
- How to add a visual calculation
- How to hide fields from the table
- Common visual types and functions
- Limitations and things to watch out for
- Get more help
How to add a visual calculation
Visual calculations are available for individual visualisations in a report. Follow the steps below to add a calculation to a visual. For this example, we'll start with a table that includes three columns:
- Primary Group
- # course assignments
- # compliant assignments
We'll add a visual calculation to include a running total of compliant assignments.
- Start a new User-created report or open an existing report
- Add a visual, for example, a table visual
- Click to select the visual so it's active
-
Select the three dots on the top-right of the visual and choose “New visual calculation”. This will open 'Edit mode'. When adding or editing, Power BI shows:
o A formula bar (for writing the DAX expression)
o A visual matrix (a tabular preview of what's in the visual)
o The fields pane / field well for that visual - Select Running Sum
-
Write your calculation. Give a name, then write your DAX expression. For example, to show a running total:
of compliant assignments = RUNNINGSUM ([# compliant assignments]): - Select the green tick/press Enter to add the calculation. The result appears as a new column (or field) in that visual.
- Select Back to report to return to the report:
The visual calculation will appear in the field well of the visual, with a special icon indicating it’s a visual calculation
How to hide fields from the table
Sometimes you add extra fields solely to support a calculation but don’t want them displayed. For example, you may want to show only Primary group and Running sum, while hiding the other supporting fields.
Because it’s a visual calculation, you can’t remove those fields entirely - they’re needed for the calculation to work.
While in visual calculation edit mode (before selecting Back to report), you can hide fields by clicking the eye icon. This keeps them in the calculation but removes them from the visual display.
Common visual types and functions
| Type | Description/example | Function(s) |
| Running sum / cumulative | Sum current + previous values | RUNNINGSUM(...) |
| Moving average | Average over a sliding window | MOVINGAVERAGE(...) |
| Percent of parent | Show a part’s share relative to its group | DIVIDE([Value], COLLAPSE([Value], ROWS)) |
| Percent of grand total | Relative to all values | DIVIDE([Value], COLLAPSEALL([Value], ROWS)) |
| Versus previous / vs next | Difference from prior or next row | PREVIOUS(...), NEXT(...) |
| First / Last | Reference first or last value in axis | FIRST(...), LAST(...) |
| Lookup functions | Evaluate an expression elsewhere in the visual | LOOKUP(...) or LOOKUPWITHTOTALS(...) |
| Collapse / Expand | Evaluate at higher or lower levels | COLLAPSE(...), EXPAND(...) |
Some of these functions have additional parameters (Axis, Reset, OrderBy) to control how the calculation walks across rows/columns in that visual.
Example with Reset: RUNNINGSUM([Sales], HIGHESTPARENT)
This makes the running sum restart for each parent group (e.g. by year) rather than continuing across groups.
Limitations and things to watch out for
- Given that visual calculations are in preview, there are several important limitations and caveats to keep in mind:
- Not all visuals support visual calculations (e.g. slicers, R visuals, Python visuals, decomposition tree, etc.)
- You cannot filter on a visual calculation (i.e. use it in slicers or filters)
- You cannot pin visuals with visual calculations to dashboards / tile them.
- Drill-through (see records) does not work on visuals with visual calculations.
- You can’t use relationships-based DAX functions (e.g. RELATED, USERELATIONSHIP) inside visual calculations.
- You can’t reuse visual calculations across visuals — they belong to a specific visual.
- Performance may vary - because the calculation happens at the visual level, for large visuals or complex logic, performance must be tested.
Because of these, visual calculations are often best suited for supplementary, on-visual enhancements rather than core business logic (especially in embedded or production contexts).
Get more help
Google will provide more help with visual calculations. It is also worth checking out what Microsoft has to offer about visual calculations, as it is a native Power BI feature.
If you have access to ChatGPT or other AI tools, they are useful for checking syntax and explaining what a visual calculation is doing. Here’s the earlier example fed into ChatGPT for an explanation of the DAX: