Forum Discussion
Rodrivieiras
4 years agoHelper I
Average formula
Hello, I'm starting Power BI studies and I have a table called ProductSales with millions of data to analyze. Below is a sample of the data PERIOD PRODUCT PRICE 2001-07 TOY 10 2...
- 4 years ago
Rodrivieiras
Again my mistakeAverageSold = DIVIDE ( COUNTROWS ( 'ProductSales' ), COUNTROWS ( VALUES ( Calendar[Month] ) ) )
tamerj1
4 years agoCommunity Champion
Sorry I misunderstood the question. Your approach is correct except a small detail. If you are slicing by product then
AverageSold = DIVIDE ( COUNTROWS('ProductSales'), VALUES(Calendar[Month])
)
Rodrivieiras
4 years agoHelper I
Hi tamerj1,
I tried your solution, but although the measure compiles successfully, I don't know how to check the result.
I used a card, but the following error message appeared:
"A table of multiple values was provided where a single value was expected"
The table view also didn't work.
Any clue?
Thanks
- tamerj14 years agoCommunity Champion
Rodrivieiras
Again my mistakeAverageSold = DIVIDE ( COUNTROWS ( 'ProductSales' ), COUNTROWS ( VALUES ( Calendar[Month] ) ) )- Rodrivieiras4 years agoHelper I
Hi tamerj1 ,
I just changed your formula a little bit by:
AverageSold =DIVIDE (COUNTROWS( ProductSales ),COUNTROWS ( VALUES(ProductSales[PERIOD] )))It worked perfectly!Thanks a lot!