Forum Discussion
Average Invoice Value
I think that mattbrice was suggesting that you add a new measure to do the calculation, then add that measure to the table.
For example:
1. Click Modeling > New Measure
2. Type the formula, e.g:
Average Invoice Value = DIVIDE ( [Sum of Price], [Count of Sales Invoice Number] )
3. Add that measure to the Values of your table
Not a programmer so maybe syntax wrong. This is what I got from the formula.
- MalS9 years agoResolver III
Apologies, the formula I used would only work if those fields were already measures...but they aren't.
A quick fix is to use this formula:
Average Invoice Value = DIVIDE ( SUM( 'Table Name'[Sum of Price]), SUM('Table Name'[Count of Sales Invoice Number] ))
(where 'Table Name' is the name of the table that stores those fields - I can't read it all in your screenshot, but it starts with 'Daily Item Sales by...' )
In the longer term, its usually a good idea to create 'explicit' measures for things like 'Sum of Price', then use those measures in other formulas. That helps if you ever need to change the measure, because you only have to edit it in one place.
- sbmeder9 years agoHelper I
Almost there. The invoice count is not a measure. It is created by using the count distinct feature of invoice numbers that relate to the customer in column 1. So right now getting $0 in that column.
- MalS9 years agoResolver III
Ahh - ok. Maybe try:
Average Invoice Value = DIVIDE ( SUM( 'Table Name'[Sum of Price]), DISTINCTCOUNT('Table Name'[Sales Invoice Number] ))