Home

Calculate the average count of items in a table

%3CLINGO-SUB%20id%3D%22lingo-sub-539480%22%20slang%3D%22en-US%22%3ECalculate%20the%20average%20count%20of%20items%20in%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-539480%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20table%20of%20product%20from%20a%20client.%20I%20need%20to%20calculate%20the%20average%20total%20price%20of%20products%20as%20well%20as%20average%20count%20of%20products%3C%2FP%3E%3CP%3EI%20used%20this%20dax%20expression%20for%20average%20total%3CBR%20%2F%3E%60%60%60%3CBR%20%2F%3EAverage%20Total%20of%20Price%20%3D%3CBR%20%2F%3ECALCULATE(%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAVERAGE(wedding_data%5BPrice%5D)%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20)%3C%2FP%3E%3CP%3EHere%20is%20the%20sample%20of%20the%20table%3CBR%20%2F%3E%5BBuyer%5D%2C%20John%2CFrancis%2C%20Charles%2C%20John%2C%20Francis%3CBR%20%2F%3E%5BWedding%20Date%5D%2C%206%2F1%2F2019%2C%201%2F2%2F2019%2C%209%2F1%2F2019%2C%206%2F1%2F2019%2C%207%2F7%2F2019%3CBR%20%2F%3E%5BLocation%5D%2C%20AK%2C%20NY%2C%20CO%2CAK%2C%20TX%3CBR%20%2F%3E%5BProduct_Name%5D%2CiPad%2C%20Jewel%2C%20Books%2C%20Jewel%2C%20Shoe%3CBR%20%2F%3E%5BPrice%5D%2C%20%245%2C%20%247.5%2C%20%246.12%2C%20%2410%2C%20%2421%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20the%20DAX%20above%2C%20one%20will%20obtain%20the%20average%20total%20price%3C%2FP%3E%3CP%3ENow%20I%20need%20to%20do%20the%20average%20count%20of%20product%2C%20with%20the%20right%20DAX%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EHowever%2C%20I%20am%20not%20sure%20what%20expression%20to%20use%20for%20average%20count%20for%20each%20product.%3C%2FP%3E%3CP%3EI%20am%20suppose%20to%20get%20a%20value%20that%20if%20I%20multiply%20by%20the%20number%20of%20items%2C%20I%20will%20give%20the%20total%20sum%20of%20items.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-539480%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-540126%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20the%20average%20count%20of%20items%20in%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-540126%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F313611%22%20target%3D%22_blank%22%3E%40AKP_1%3C%2FA%3E%26nbsp%3B%2C%20for%20Average%20price%20it's%20enough%3C%2FP%3E%0A%3CPRE%3EAverage%20Total%20of%20Price%20%3A%3D%20AVERAGE(wedding_data%5BPrice%5D)%3C%2FPRE%3E%0A%3CP%3EAverage%20count%20-%20it's%20average%20per%20buyer%2C%20per%20date%20or%20what%3F%20If%20per%20buyer%20that%20could%20be%3C%2FP%3E%0A%3CPRE%3EAverage%20Count%3A%3DCOUNT(wedding_data%5BProduct%5D)%2FDISTINCTCOUNT(wedding_data%5BBuyer%5D)%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
AKP_1
Occasional Contributor

Hello everyone, 

 

I have a table of product from a client. I need to calculate the average total price of products as well as average count of products

I used this dax expression for average total
```
Average Total of Price =
CALCULATE(
                   AVERAGE(wedding_data[Price])
                    )

Here is the sample of the table
[Buyer], John,Francis, Charles, John, Francis
[Wedding Date], 6/1/2019, 1/2/2019, 9/1/2019, 6/1/2019, 7/7/2019
[Location], AK, NY, CO,AK, TX
[Product_Name],iPad, Jewel, Books, Jewel, Shoe
[Price], $5, $7.5, $6.12, $10, $21

 

Using the DAX above, one will obtain the average total price

Now I need to do the average count of product, with the right DAX,

However, I am not sure what expression to use for average count for each product.

I am suppose to get a value that if I multiply by the number of items, I will give the total sum of items.

 

1 Reply

@AKP_1 , for Average price it's enough

Average Total of Price := AVERAGE(wedding_data[Price])

Average count - it's average per buyer, per date or what? If per buyer that could be

Average Count:=COUNT(wedding_data[Product])/DISTINCTCOUNT(wedding_data[Buyer])