Home › Forums › Power Pivot › Average by Month – only the months have sales
This topic contains 3 replies, has 3 voices, and was last updated by tomallan 8 years, 1 month ago.
-
AuthorPosts
-
March 16, 2016 at 6:28 pm #3776
I have the following data: product, quantity sales month. I would like to know the average sale period only the months have sales
Product 1 2 3 4 5 6 7 8 9 10 11 12 Total Average
Prod_A 0 0 10 0 3 11 10 5 64 20 91 0 214 27 (214 / 8 = 27)
Prod_B 0 0 0 20 0 10 0 3 3 0 50 0 86 17 (86 / 5 = 17)
tks
Rogerio
March 16, 2016 at 6:42 pm #3777Hi Rogerio,
How is the data structured , can add the file so we can try to help you.
However, if you want to create a measure that calculate the average for products if they have sales more than 0 then you can use this formula:
measure:=CALCULATE(AVERAGE(Table[product]),Table[product]>0)
Thanks
March 16, 2016 at 6:56 pm #3778March 16, 2016 at 11:42 pm #3783Rogerio,
I am glad Fahad asked you to look at the data, it changed my point of view entirely.
If monthly quantities are pre-aggregated (one record per month and per product), your question has already been answered.
However, if your data could have many records per product per month, then your answer could look like this (excluding any checks to ensure that the measure will be run only on sub-totals and grand totals):
Average of Monthly Total Quantity Sales :=
AVERAGEX (
FILTER (
ADDCOLUMNS (
VALUES ( ‘Calendar'[Month] ),
“Monthly Sales”, CALCULATE ( SUM ( Data[Quantity Sales] ) )
),
[Monthly Sales] > 0
),
[Monthly Sales]
) -
AuthorPosts
The forum ‘Power Pivot’ is closed to new topics and replies.