Forum Discussion
Averages
- 10 years ago
Right, sorry, you have to use aggregates in a measure, so the proper formula would be:
Pages/Session = DIVIDE(SUM([Pageviews]),SUM([Sessions]),0)
I have daily data for pageview and sessions from Google Analytics. I then have a column calculating Pages/Session using this simple formula: Pages/Session = DIVIDE([Pageviews],[Sessions],0)
If I add this to a table it changes it to daily values
http://i.imgur.com/OWfGu0S.png?1
http://i.imgur.com/KZH5ulE.png?1
Try changing your custom column to a measure instead. I believe what you are seeing is that since Pages/Session column exists for every row, it is switching your table back to daily values. Using a measure should fix this.
- procyon8210 years agoResolver I
If I do that it tells me: The value for 'Pageviews' cannot be determined. Either 'Pageviews' doesn't exist, or there is no current row for a column named 'Pageviews'.
If I specify the table name I get:
A single value for column 'Pageviews' in table 'GA Traffic' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
I think the solution is to use DAX, so I tried this formula, which gives me the same average that is calculated from daily values instead of the sum of all those values:
Pages/Session Measure = SUMX('GA Traffic',DIVIDE('GA Traffic'[Pageviews],'GA Traffic'[Sessions],0))/COUNTROWS('GA Traffic')
I'm not sure what I need to do to fix that.
- Greg_Deckler10 years agoCommunity Champion
Right, sorry, you have to use aggregates in a measure, so the proper formula would be:
Pages/Session = DIVIDE(SUM([Pageviews]),SUM([Sessions]),0)
- procyon8210 years agoResolver I
Greg_Deckler That did it! Thanks a lot.