Pragmatic Works Nerd News

Create Measures in the Power BI Service with Visual Calculations

Written by Greg Trzeciak | Dec 09, 2024

Greg Trzeciak from Pragmatic Works introduces an exciting feature in Power BI: creating measures through visual calculations directly in the Power BI service. In this video, Greg walks viewers through the process of using visual calculations without needing to return to Power BI Desktop, allowing for more flexibility in report building and data analysis.

 

Why Use Visual Calculations?

Visual calculations in Power BI Service allow users to build quick measures directly within their reports, without having to switch back to Power BI Desktop. This feature, though still in preview, enables users to edit and create calculations on-the-fly, making it a convenient tool for adjusting reports and testing ideas.

How to Create a Visual Calculation

To create a visual calculation, Greg demonstrates the following steps:

  1. Select a visual in the Power BI service where you want to apply the calculation (e.g., a revenue by country chart).
  2. Right-click on the visual and choose New Calculation from the options menu, or access the calculation option via the ellipsis menu (three dots) in the top-right corner of the visual.
  3. Choose the type of calculation from the template options under the FX button (e.g., running sum, moving average, percentage of grand total).

Greg emphasizes that users must have edit access to the report in order to create visual calculations, as viewers cannot perform this action.

Using Visual Calculation Templates

Power BI Service offers several templates for visual calculations, including:

  • Running Sum
  • Moving Average
  • Percent of Parent
  • Percent of Grand Total

These templates allow users to quickly apply common calculations to their visuals. For instance, Greg demonstrates how to apply a running sum to a revenue by country chart by selecting Running Sum from the FX menu and replacing the field with Revenue.

Saving and Editing Visual Calculations

Once a visual calculation is created, it becomes part of the report. The changes are saved when the report is updated, and users can drill down into the visual while retaining the calculation. This flexibility allows for real-time adjustments without the need to switch back to Power BI Desktop.

Limitations of Visual Calculations

While visual calculations are a powerful tool, Greg highlights a few limitations:

  • Not all visualizations support visual calculations. Some visuals are grayed out and cannot use this feature.
  • Formatting options for calculations (e.g., converting numbers to currency) are limited in the service. Attempting to format using DAX may result in the calculation disappearing, as Greg demonstrates with a running sum.

Despite these limitations, visual calculations still offer significant value by enabling quick, on-the-fly analysis.

Exploring Other Calculation Templates

Greg also explores other templates, such as the Moving Average. He applies a moving average calculation to the same revenue chart, setting the window size to 3 to demonstrate how this calculation works within the service. While this example is more about functionality than meaningful data insights, it illustrates the versatility of the tool.

Conclusion

Visual calculations in Power BI Service provide a quick and easy way to perform calculations without returning to Power BI Desktop. Though there are some limitations, such as formatting restrictions and limited visualization compatibility, the feature’s flexibility makes it a valuable addition for users looking to build or enhance reports in real time.

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power BI and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.