Insert calculated rows
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 formula syntax for a detailed list of functions, operators, and identifiers that can be used for calculations.
Let us take this 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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FPkldD0mXMmChnbDtxJDi%252F4.1.1%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3Deabaa15f-ed25-4adb-8c40-2be532a5d103&width=768&dpr=4&quality=100&sign=8bf4ac38&sv=1)
a) Select the Tea & Coffee row above which we need to insert the row. In the 'Insert' tab, click on the 'Insert row' dropdown. Click on 'Calculated row'.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FFutyQKphahviCdqOSBnC%252F4.1.2%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D7c16bca3-68d1-49bc-9145-ff4aa05a62a5&width=768&dpr=4&quality=100&sign=b0b1f8ff&sv=1)
b) A blank row gets inserted and a side panel opens up as shown.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FPIb8MsRste1JS2N4kLtK%252F4.1.3%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3Dadded264-b902-47e8-ae47-2557008670d1&width=768&dpr=4&quality=100&sign=91c79735&sv=1)
1. Formula editor
a) Rename the title and click on the formula editor. You can see a list of available functions in the 'Functions' tab.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252F7iGZWoVs0gDbNwGxUmjA%252F4.1.4%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3Dd8eeecc4-4aab-4d8d-bd5d-d34e90d2ac2f&width=768&dpr=4&quality=100&sign=1cb1f5ef&sv=1)
b) As you start typing, the list of functions narrows down to match the entered text. Click on 'Min'.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FSqpTL3eq7h6gekcTiwu8%252F4.1.5%282%29%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D1f560460-092b-4d32-9017-1de055a065c5&width=768&dpr=4&quality=100&sign=55bcd650&sv=1)
c) You can see the syntax for the function. Click on the arrow highlighted.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FJrd3jGYd4OXiHNQY0GJu%252F4.1.6%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D777f7888-006c-4267-bfc8-51de54cf6787&width=768&dpr=4&quality=100&sign=62b46267&sv=1)
d) You can see an explanation of the arguments and examples.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FhhmW0oldKYCg0RAl2TJP%252F4.1.7%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3Dc92c5376-3004-4cb4-9814-47fa7f0dc168&width=768&dpr=4&quality=100&sign=6e2b9fc6&sv=1)
e) To insert a particular row, you can simply click on it when the cursor is placed in the formula editor.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FWQx4G8KifvOuVIZ4Oq5i%252F4.1.8%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D54f98a7b-5e77-4e97-9542-b54d03096b01&width=768&dpr=4&quality=100&sign=2994ec95&sv=1)
f) 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'.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FOwS4tdRxzd0FkPlNWMbG%252F4.1.9%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D5e39044c-795b-4650-8fe2-2cdda2e79377&width=768&dpr=4&quality=100&sign=b028cd5a&sv=1)
g) Type a '.' after Beverages and select 'Soda' from the dropdown.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FVKhL9DNfg1aoHRlUrvr6%252F4.1.10%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D8ba156e1-c49c-4906-b91d-ccbb7eebbbf4&width=768&dpr=4&quality=100&sign=e6dae316&sv=1)
h) Finish typing the formula as shown below.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FvXMqJyxVrniuiFGLP4LR%252F4.1.11%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D8d81ce20-62da-42b4-a4a7-7fccd09ae682&width=768&dpr=4&quality=100&sign=32babf8&sv=1)
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 Insert Sum of rows and Insert Avg of rows options from the 'Insert Row' menu.
Select the desired rows first holding down the Ctrl key and then select Insert Sum of rows.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FshotO6wNOCeDkQh4WzEB%252Fimage.png%3Falt%3Dmedia%26token%3D2efa64ad-7a7f-423f-9949-3318dea23804&width=768&dpr=4&quality=100&sign=28f29fb5&sv=1)
A new row containing the sum of the selected rows is created as shown below. You can use the side panel to make any additional changes. Observe how the formula editor has been automatically populated with the selected rows.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FxLRGjF9USdGbu923g7hh%252Fimage.png%3Falt%3Dmedia%26token%3D7d8a9317-6794-4964-bf8f-765940f4739b&width=768&dpr=4&quality=100&sign=22c52c2b&sv=1)
Similarly, for calculating and inserting the average of rows, use Insert Avg of rows.
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FkdfVVPA5y907vt9lTsqt%252Ferrormsgsinformula.gif%3Falt%3Dmedia%26token%3D058a736c-fb09-4120-8c3f-88b654ef8688&width=768&dpr=4&quality=100&sign=9898ca0f&sv=1)
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'.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FGR50mLBnyyrGSBgfkFEC%252F4.1.12%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D82061cf4-07a2-435f-a828-44e88b7ee852&width=768&dpr=4&quality=100&sign=40f2d46&sv=1)
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FNvStpVMaIV6o9cJbANHI%252F4.1.13%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3Dde446b32-f8b0-45e7-bbe0-d9e6c32cfeb7&width=768&dpr=4&quality=100&sign=daa366a8&sv=1)
c) Let's uncheck the 'Include in total' checkbox and click 'Update'.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FT5ZefGNDPW9JyCltNH3c%252F4.1.14%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D4e4a2758-5ae9-4181-8432-9e8a7ef1d2c5&width=768&dpr=4&quality=100&sign=b1770d97&sv=1)
d) You can see that the grand total has now reverted back to the original value of 239m.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FXPEGPO9WxWhT8LtSvN1H%252F4.1.15%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D4ce78e3b-ee5e-4edf-b054-cacfcbcb1ce2&width=768&dpr=4&quality=100&sign=c5035205&sv=1)
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FazrQXFiK53vV1wS6sNIw%252F4.1.16%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D5f8d6a4e-9ddc-4915-8607-ede059c0f68d&width=768&dpr=4&quality=100&sign=516c35a1&sv=1)
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252Fl8Ua8oXkRrZ0s1MUOScW%252F4.1.17%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D76be4b4f-f902-4127-8793-f5cab0ba4a02&width=768&dpr=4&quality=100&sign=b3851231&sv=1)
c) Notice that the Specialty Beverages row is also visualized using the bar chart.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FbvQdCDLEB8kfuQAPXx17%252F4.1.18%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D815837db-584a-4c58-8d22-b6ff1c7da296&width=768&dpr=4&quality=100&sign=bdd5623f&sv=1)
d) On unchecking the 'Include in charts' checkbox and clicking 'Update', you can see that the calculated row is no longer shown as charts.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252Fs32B7fmDIBn3KQKBWV4Q%252F4.1.19%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D91015cf9-f608-43bf-a76c-315ee2ed9aab&width=768&dpr=4&quality=100&sign=ec6e3b60&sv=1)
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FITbPtncCF1LvEUlLM3Yj%252F4.1.20%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D43af4dcd-042a-438f-aa18-09f0c66b3510&width=768&dpr=4&quality=100&sign=b3ba75a0&sv=1)
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252Fzrl50EtlwdUnhe8lt0c4%252F4.1.21%2520Calculated%2520row.png%3Falt%3Dmedia%26token%3D0d6419da-90e3-459f-9d04-2a5beb3117b3&width=768&dpr=4&quality=100&sign=67f050e4&sv=1)
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FFcmE4bpnIpKEftwgonvg%252F7.3.%2520Custom%2520scaling%2520for%2520calculated%2520rows.png%3Falt%3Dmedia%26token%3D3bf7bc1c-23bd-484d-8112-7ffb855662eb&width=768&dpr=4&quality=100&sign=2f1dec98&sv=1)
6. Bind for Cross filter/RLS
You can enable the Bind for Cross filter/RLS option – this ensures that cross-filter selections and RLS settings apply to calculated/manual input rows that reference other rows. For example, if this option is not enabled, a manager handling Canada accounts can view a manually inserted row that references US data or an inserted region that is manually created at the visual level.
You can bind inserted rows by selecting a reference row or a dimension category.
Binding by selecting a row
To select a particular reference row, choose Row from the SelectionType dropdown. The Alaska>Inforiver hierarchy references the Canada row in the example below.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FJOGhrpHC9gBBpJZDfCTx%252F6.1.1.%2520Bind%2520row.png%3Falt%3Dmedia%26token%3Dd5947c77-03ad-4e71-86d2-ebd77c2a1859&width=768&dpr=4&quality=100&sign=d6adb485&sv=1)
The Alaska hierarchy is displayed for users with RLS access to Canada data.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FWm5AayxNFrrnSir1r0WN%252F6.1.2%2520Bind%2520rows%2520output.png%3Falt%3Dmedia%26token%3D4b3ac805-c061-474e-bfa4-69f02cd4145e&width=768&dpr=4&quality=100&sign=e5b3186a&sv=1)
Dimension category
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.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FCIn5XpGdPILW5lbv5iQV%252F6.1.3.%2520Bind%2520dimension.png%3Falt%3Dmedia%26token%3D40dd8296-3749-4ebd-8ba6-a703ecff8764&width=768&dpr=4&quality=100&sign=746a6644&sv=1)
Notice how the adjustment row is displayed for users with access to Paseo products.
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252FyM17GuziLpor19H0KmiE%252F6.1.4.%2520Bind%2520dimension%2520output.png%3Falt%3Dmedia%26token%3Dad00953c-4fed-4bbb-a16a-ecf508848304&width=768&dpr=4&quality=100&sign=bbd0b312&sv=1)
Resources
Insert Formulas, Columns and Aggregation
Visual calculations using Inforiver
Implement SUM measure totals in Power BI (without using DAX)
Last updated