Last Modified Date: 04 Aug 2016
- Tableau Desktop 9.2
ResolutionTo achieve the desired result, aggregate the values before calculating the percentage ratio. For example:
SUM([Units Sold]) / SUM([Units in Market])Instead of:
[Units Sold] / [Units in Market]
CauseThe original calculation would run for each row in the data set, and if the calculated field is then used in the view, those results would be aggregated to the level of detail in the view. For example, if the data source has date entries for every month, but the date is viewed by quarter, the values of the calculated field will be summed after calculating the ratio. This would not result in the expected value because the calculation would be aggregating the individual ratio values.
By aggregating the values, the calculation can still be run for each row of the data set, but if the view provides a different level of detail, such as date by quarter or year instead of month, this calculation will run again, first aggregating all the values for field by summing the data fields by quarter or year respectively, and then calculating the average.
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials