Power BI Visual Calculations: A Simpler Way to Analyze Data Without DAX

One of the biggest challenges when learning Power BI is mastering the DAX (Data Analysis Expressions) language. It is a powerful tool for data analysis, but it’s hard to learn due to its abstraction and the strict structure of the data model it relies on. A new feature called visual calculations, still in preview in Power BI Desktop, makes things easier by allowing calculations to be created directly in the visuals – much like Excel formulas.

Enabling visual calculations in Power BI

As this feature is still in preview, the first step is to enable it in the Power BI Desktop options. This is the usual method Microsoft uses to introduce new features before their official release.

What’s different between DAX and visual calculations?

Visual calculations offer a more practical way to create common indicators found in most reports, such as running totals, moving averages, percentages of totals, and so on.

In DAX, these calculations require a data model and, when dealing with “time intelligence” measures – such as comparing current and previous periods – a calendar table is essential to filter the data model correctly. DAX performs calculations over the data model.

Visual calculations, on the other hand, are created directly in the visuals, making it easier to reason about what’s being calculated. They are not stored in the data model, but instead live within the visualizations themselves.

Of course, you still need a data model behind the visuals. The filter context still applies, but the complexity is reduced, as you are working directly with what you see in the chart.

Visual calculations example – Skateboard store

Let’s explore an example using the demo model of a skateboard store, analyzing the sales page:

You can download this sample report from the Microsoft GitHub repository.

The page contains typical sales analysis visuals. The first chart shows sales by product category, followed by store-level sales and a time series chart.

To create a visual calculation in the first chart, simply click the designated button:

A panel opens below the visual, where you can write the formula and preview the data and result:

The following templates are available when creating visual calculations:

  • Running total
  • Moving average
  • Percent of parent
  • Percent of grand total
  • Average of child items
  • Compare to previous item
  • Compare to next item
  • Compare to first item
  • Compare to last item

Additionally, most DAX functions are also supported.

For example, to calculate the percentage of each item in relation to its parent category, you can use the “Percent of parent” template:

The default expression will look like this:

Percent of parent = DIVIDE([Field], COLLAPSE([Field], Axis))

This uses two key functions:

  • DIVIDE – divides one value by another
  • COLLAPSE – a visual calculation-specific function that navigates one level up in the visual hierarchy

You can modify the formula as follows:

Percent of parent = DIVIDE([Net Sales], COLLAPSE([Net Sales], ROWS))

The optional argument ROWS tells Power BI to calculate vertically across rows. This approach focuses entirely on the visual layout, ignoring the data model underneath.

The result would look like this:

By default, the value is plotted along the Net Sales axis:

However, the values may appear too small to be useful due to scale differences:

One solution is to move the calculation to the tooltip instead:

In this case, you should format the value as a percentage using the FORMAT function:

Percent of parent = FORMAT(DIVIDE([Net Sales], COLLAPSE([Net Sales], ROWS)), "0.00%")

This makes the tooltip much easier to read.

You could also switch the bar chart to a matrix visual. In this example, the matrix includes three row levels: Category, Segment, and Product. This enables drill-down and drill-up navigation, while keeping both Net Sales and percentage values visible side by side:

In an upcoming article, I’ll explore how visual calculations compare to DAX in terms of performance.

Share your love
Nuno Nogueira
Articles: 46