Power up Your Analytics Using Visual Calculations in Power BI
Visual Calculations in Power BI

Power up Your Analytics Using Visual Calculations in Power BI

Unleashing the Power of Visual Analytics in Power BI

A new feature under preview has been released in Power BI Feb 2024 update. This long waited feature was about what is known as Table Calculations in the context of data analytics.

Visual Calculations

This kind of calculations take place in a virtual table environment. It relies completely on the visualized data in a table or a matrix without interacting with the underlying data nor the data model. They are mainly used with 'Table' and 'Matrix' visuals to perform calculations like:

  • Running Average
  • Moving Window Average.
  • Growth %
  • Percent of Grand Total.

These types of calculations were performed previously using some DAX function. Which in turn mean that they were calculated using both the data model and the underlying data.

With the introduction of this new feature, you can implement such calculations very easily on top of the data model and underlying data.

Advantages of Visual Calculations

Visual calculations allow you to create DAX formulas directly within a visual element in your Power BI report. This offers several advantages:

  • Simplified Calculations: You can perform calculations directly on the data displayed in the visual, often eliminating the need for complex DAX measures in the data model.
  • Easier Maintenance: Visual calculations are specific to a particular visual, making them easier to manage and understand compared to global measures.
  • Improved Performance: Calculations are applied within the visual, potentially leading to better performance in some cases.


Using Visual Calculations

Here's how to create and use visual calculations in Power BI Desktop (currently in preview mode):

  1. Enable Preview Feature: Go to File > Options and Settings > Options. Under Preview features, select Visual calculations and click OK. Restart Power BI Desktop.
  2. Create a Visual: Create a visual element (e.g., bar chart, table) in your report.
  3. Open Calculation Pane: Click the New calculation button in the ribbon (or right-click the visual and select Visual calculations).
  4. Enter DAX Formula: In the formula bar, type the DAX expression you want to calculate within the visual. You can use existing measures, fields, and DAX functions.
  5. Apply Calculation: Click Enter or the checkmark icon to apply the calculation.

Example

Here in the below table, we need to add a moving average column:

Matrix Visual in Power BI

to do so, we right click on the visual and select 'New Calculation'

New Calculation Window

Then, a calculation window will pop up as shown below:

Calculation Pane

You can write a DAX formula in the formula bar or you can click on fx icon to open some ready made formulas as shown below:

In this example, we shall select Moving Average to perform the required calculation.

You need to enter the required parameters like [Field], and WindowSize.

Then you click apply.



要查看或添加评论,请登录

Yasser A. Rahman的更多文章

社区洞察

其他会员也浏览了