Forum Discussion
Count above average
I am pulling the Average Cost and Average Invoice Charge for a part. My next column is how many times it occurred, which is 88 times. I now need a column that tells me how many times the Invoice Charge was above the average. How can I do this?
Depends on your data model.
If you have a table of Products with Average Invoice Charge and another table with your Invoices, then you could link the two tables on something like Product ID and then add a calculated column or measure like:
AboveAverage = CALCULATE(COUNTROWS(RELATEDTABLE(Invoices)),Invoices[InvoiceCharge]>Products[AverageInvoiceCharge]),
Something like that.
1 Reply
- Greg_DecklerCommunity Champion
Depends on your data model.
If you have a table of Products with Average Invoice Charge and another table with your Invoices, then you could link the two tables on something like Product ID and then add a calculated column or measure like:
AboveAverage = CALCULATE(COUNTROWS(RELATEDTABLE(Invoices)),Invoices[InvoiceCharge]>Products[AverageInvoiceCharge]),
Something like that.