Description: This tutorial illustrates how to create calculated columns in a PixelPerfect report using Calculated Field
Add Calculated Field

After adding CH341 - Sales by Product CH341 - Sales by Product in the Levels node:
- Right-click on CH341_Level
- Select Add Calculated Field from the menu
- Enter AvgPrice as Name
- Click on the browse button at the extreme right of the Expression field
Refer to How to Create a Simple PixelPerfect ReportEnter the Expression

- Enter [Sales] / [Quantity] as expression
- Click on OK
You can double click on a field to insert it in the expressionInsert the Detail Report Band for "CH341_Level"

- Right click on the Detail bar
- Select Insert Detail Report
- Select "CH341_Level". The result is DetailReport1 - "CH341_Level" bar.
Embed Headings in Template

- Hold down the CTRL key on your keyboard while you select the following fields in the following order:ProductName, Sales, Quantity, AvgPrice
- Left click and hold on the selection made in Step 1.
- While holding the selection, drag and drop it into DetailReport - "CH341_Level" -> Detail1 band
- Drag the Detail1 bar upper border till it coincides with the lower border of the Level border to eliminate the white spaces
Format "CH341_Level" Cell
After clicking desired cell:
- Click on the small arrow above the upper right corner of the cell
- Click on the browse button at the extreme right of the Format String field
- Select Currency
- Click on $0.00 from the list. When done click on OK
Preview

Click on Preview
Result

See the step below to create a more complex expression and avoid the Infinity issue
Edit the Expression

- Select AvgPrice expressions
- Click on the browse button at the extreme right of the Expression field
- Enter Iif([Quantity] != 0,[Sales] / [Quantity] ,' - ' ) and click OK
Final Result

On previewing again, you can see that the word Infinity has been replaced with the ' - ' character where the quantity value is 0.