Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Wrong total amount but correct for each row

Hello, 

We are experiencing difficulties with calculating the total Cost + a percentage. The issue arises from multiplying the Cost by a specific percentage (margin). While our calculation works correctly for individual campaigns, errors occur when calculating the total amount because it also gets multiplied by the highest margin in the table. We retrieve the Cost from the Premium_facts table and the Margin from the OPI_dimensions table. Our current calculation is as follows:

Total Cost = Sum(Premium_Facts[Cost]) / (1 - Max(OPI_dimension[Margin])).

 

Is there a way to exclude the subsequent multiplication of the total value by the margin using a solution in Funnel.io or PowerBI? The attached image demonstrates that the calculation for each campaign is accurate, but when the values are aggregated, the total amount becomes significantly higher than expected:

 

We hope that you can assist us in resolving this issue. Please don't hesitate to reach out if you require additional information or have any questions. Thank you very much in advance.

Best regards

Sofie & Christian

4 Replies