Insert calculated rows (WB Matrix)

Inforiver provides an option to insert calculated rows using an intuitive formula editor. The Excel-like formula engine supports 50+ functions (logical, boolean, math functions, and more). The formula editor provides syntax, examples, and features such as autocomplete, multi-line support, and more to help users create and troubleshoot formulas.

Refer to the formula syntax section for a detailed list of functions, operators, and identifiers that can be used for calculations.

Let us take an example where we have sales data by category and subcategory. Let's insert a row for Specialty Beverages, which is calculated as the minimum of the other subcategories in Beverages across quarters.

Select the Tea & Coffee row above which we need to insert the row. In the Insert tab, click on the Insert Row dropdown.

Select the Formula option.

Select the Formula option in Writeback Matrix

A blank row gets inserted, and a side panel opens up as shown.

Create calculated row

You can also create parent rows as calculated rows.

Parent rows as calculated rows

1. Formula editor

1.1. Rename the title and click on the formula editor. You can see a list of available functions in the Functions tab.

Enter the title

1.2. As you start typing, Inforiver's IntelliSense narrows down the list of functions to match the entered text. Click on MIN.

Select function

1.3. Inforiver displays the syntax for the function. Click on the arrow highlighted.

Formula syntax

1.4. Inforiver displays a description of the function and a detailed explanation of the arguments with examples.

Function description and examples

1.5. To insert a reference to a particular row, click on the row when the cursor is placed in the formula editor.

Referencing rows by selectingt them

1.6. The other way is to use the References tab. To access Soda, you need to type Beverages.Soda. As you start typing, the references get narrowed down. Select 'Beverages'.

Inserting a reference from the dropdown

Select 'Soda' from the dropdown.

Referencing child records from the dropdown

1.7. The calculated row gets created as shown.

Formula row is inserted

To see the underlying logic for calculated data, click on the cell to preview the formulae applied in the formula bar.

While you can use the SUM and AVERAGE functions to calculate the sum and average of rows respectively, you can also use the Aggregation option from the 'Insert Row' menu.

Select a parent-level row and choose the Aggregation option from the Insert Row menu.

Inserting aggregated rows

Select the aggregation type from the dropdown menu.

Creating a custom aggregated row

Any errors in the formula can be easily located with clear and concise error messages. In the maximized formula editor view, you will also notice line numbers, allowing you to quickly locate and fix errors.

Fixing errors in formula

2. Include in total

a) Check the 'Include in total' checkbox as we need the Specialty Beverages value to be included in the Beverages total and the grand total. Click 'Create'.

Including calculated row in total

b) You can see that the row is renamed and the values are populated. There is also a formula bar on the top which shows the formula defined.

Note that the grand total is now updated to 255m.

Calculated row inserted

c) Let's uncheck the 'Include in total' checkbox and click 'Update'.

Excluding Specialty Beverages from total

d) You can see that the grand total has now reverted back to the original value of 239m.

Specialty Beverages excluded from total

3. Include in charts

a) Check the 'Include in charts' checkbox and click 'Update'.

The 'Include in charts' checkbox is enabled only when the 'Include in total' option is unchecked.

Include in charts

b) Let's now add a bar chart to 2022 Actuals. Click on the column and select the highlighted bar chart from the 'Home' tab.

Adding a bar chart

c) Notice that the Specialty Beverages row is also visualized using the bar chart.

Bar chart shown for calculated row

d) On unchecking the 'Include in charts' checkbox and clicking 'Update', you can see that the calculated row is no longer shown as charts.

Calculated row shown as numbers

4. Evaluate column before rows

When inserting calculated rows, in some cases you might want the total to be the sum of the child columns whereas in other cases, it needs to follow the defined formula. This behavior can be configured using the 'Evaluate column before rows' option.

Let's consider an example where we are inserting the relative variance between two rows. In the below image, with 'Evaluate columns before rows' enabled, you can see that the variance for the grand total is calculated based on the grand total values of Pacific and Central.

Total value calculated based on formula

When 'Evaluate columns before rows' is disabled, the grand total variance is calculated as the sum of Beverages and Water which is not the expected behavior in this case.

Total value calculated as sum of category values

5. Custom scaling

In certain cases, the values in calculated rows may not conform to the number scaling set at the report level. You can apply a custom scaling factor based on the nature of the calculation applied.

Scaling Factor

6. Bind for Cross filter/RLS

You can enable the Bind for Cross filter/RLS option to ensure that cross-filter selections and RLS settings apply to calculated/manual input rows that reference other rows. For example, a manager handling 'Canada' accounts should only be able to access 'Canada' data. If this option is not enabled, he can view a manually inserted row that references data from other regions(child rows) or an inserted region that is manually created at the visual level(parent rows).

You can bind inserted rows by selecting a reference row or a dimension category.

Binding by selecting a row

Let's consider these RLS rules defined based on regions:

RLS rules defined in Power BI

To select a particular reference row, choose Row from the SelectionType dropdown. The Alaska>Velo hierarchy references the Canada row in the example below. Click the Canada row to reference it in the Selected Row field. Only users with access to 'Canada' data will be able to view the Alaska level.

Bind by row config

The Alaska hierarchy is displayed only for users with RLS access to Canada data.

Users with Canada access can see the inserted row

Similarly, a user with access to 'France' data will be able to see the Austria level but not the Alaska level.

Binding the inserted row to France data

The user can view Austria and France:

User can view the rows bound to the France row

Dimension category

RLS rule defined for product access:

RLS rule for accessing the Paseo product

To bind the inserted row to a particular dimension category, choose Dimension member from the SelectionType dropdown. In the example below, the Paseo adjustment row references the Paseo product.

Config for binding to a dimension

Notice how the adjustment row is displayed for users with access to Paseo products.

PaseoAdj row is visible to users with access to the Paseo product

Resources

Insert Formulas, Columns and Aggregation

Visual calculations using Inforiver

Implement SUM measure totals in Power BI (without using DAX)

Excel-like MoM, QoQ, YoY % Calculations in Rows in Power BI

Last updated

Was this helpful?