You are here:
Attribute-Based Pricing with Usage Pricing and Cost and Margin
A calculation matrix for attribute-based pricing can be expanded to handle usage pricing, cost and margin, or both. You must also update the PricingPlanHelper Apex class and the Pricing Plan.
Because Energy & Utilities Cloud makes extensive use of usage pricing, the example shown here is related to Energy. You can apply the same principles to matrices for Salesforce Industries Communications, Media, and Energy.
To use attribute-based pricing with usage pricing and/or cost and margin:
- If you're using usage pricing, set it up as described in Usage-Based Pricing for Industries CPQ.
- If you're using cost and margin, set it up as described in Cost and Margin in EPC.
-
If you're using cost and margin, set the MarginCalculationType setting to
margin. See CPQ Configuration Settings Reference. - Create a calculation matrix similar to the matrix described in Set Up AttributePricingMatrix, Setting Up SourceTargetAttributePricingMatrix, or Setting Up RangeAttributePricingMatrix.
- For usage pricing, add output columns for the unit rate and the charge measurement. For cost and margin, add an output column for the cost.
- In the related calculation procedure, add variables that match the pricing variables you are using for usage pricing and cost and margin.
- In the related calculation procedure, map each matrix output column to the corresponding variable. Be sure to check the Include in Calculation Output checkbox.
- In the PricingPlanHelper Apex class, update the output map to include the variables.
- Update the Pricing Plan to call the calculation procedure and calculation matrix.
- To update unit rates and costs efficiently, you can upload the data from a CSV file. See Prepare a CSV File to Upload to a Calculation Matrix.

