Visual Calculations

If you want to present a report based on data, you will do so by connecting to the source, purifying, modeling it and then adding appropriate visualizations. As part of the modeling process, we often created measures and calculated columns by writing DAX statements. In a similar way, we were able to add Quick Measures. Now there is an even easier way, and that is to create calculations within a visual…

Visual calculations is a new option that, based on DAX statements, performs calculations and displays them directly in the visualization-chart. This option is still in the trial phase, it has been available since the beginning of the year, so if you want to use it, you need to go to the Power BI Desktop options and activate it. After restarting, it will appear in the Calculations group of the Home ribbon.

Select the visualization where you want to apply this option. In this example, we will use a line chart that shows sales according to time. Select New Calculation. Power BI Desktop will focus on the selected visualization and then on the formula box, where you need to enter the needed DAX statement with which you will visualize the data. If you are not sure what to write, click the fx button and it will offer several templates.

Let’s choose the one for calculating the cumulative sum (Running Sum), and then correct the formula. Within the DAX function RUNNINGSUM, we will add as an argument a measure containing sales revenue (SalesRevenue). The result is a line chart showing growth and cumulative sales growth.