Forum Discussion
Catman
1 year agoFrequent Visitor
Calculating Weighted Average
I would like to calculate the weighted average value for each customer like below: I need to calculate the Total Amount by customer and the weight %, then I can multiply by the Payment Days to obtai...
- Anonymous1 year ago
Hi Catman ,
Thank you for sharing the update!
It might happening because the total amount by customer is being calculated at the invoice level instead of staying fixed for the customer. This happens when the visual includes invoice-level detail, and the measure does not ignore that context. To get the right weight % and average payment days, the total amount should remain the same across all invoices for a customer. Also, since your Customer and Invoice tables are separate, just make sure there is a proper relationship between them.
Hope this helps.
Thank you.
Catman
1 year agoFrequent Visitor
Hopefully this is a bit easier to understand.
| Customer | Invoice | Total Amount by Customer | Amount/Total | Amount | Paymentdays | Average Payment Days by Customer |
| Input | Input | Calculated - sum Amount for Customer | Calculated | Input | Input | Calculated % * Paymentdays |
| A | 10001 | 900,000.00 | 10.2054% | 91,848 | 90 | 9 |
| A | 10002 | 900,000.00 | 37.5477% | 337,929 | 45 | 17 |
| A | 10003 | 900,000.00 | 4.9367% | 44,430 | 90 | 4 |
| A | 10004 | 900,000.00 | 39.5216% | 355,695 | 45 | 18 |
| A | 10005 | 900,000.00 | 7.7886% | 70,097 | 90 | 7 |
| 900,000 | 55 |
Ashish_Mathur
1 year agoSuper User
Hi,
PBI file attached.