Percent of Total from Database

Hi, I’m trying to get the percentage of total revenue by each of the top 10 Brands (dimension).

The logic would be: (Revenue per Brand / Total Revenue)*100. But since it’s the top 10 Brand, if I try to do a table calculation it will not get the global Total Revenue but only the sum of the top 10.

I need the Total Revenue considering all the brands from the database, can you help?

Solved Solved
0 1 194
1 ACCEPTED SOLUTION

Hey Vinicius, how exactly you are selecting those top 10 brands? 

We could, for example, not limit the rows (brands), having this way the total for all the brands, sort them accordingly , and then limit the displayed rows in the visualization: 

https://docs.looker.com/exploring-data/visualizing-query-results/table-next-options#limit_displayed_...

Also, you may possibly use the percent_of_total measure https://docs.looker.com/reference/field-reference/measure-type-reference#percent_of_total instead of table calculation

View solution in original post

1 REPLY 1

Hey Vinicius, how exactly you are selecting those top 10 brands? 

We could, for example, not limit the rows (brands), having this way the total for all the brands, sort them accordingly , and then limit the displayed rows in the visualization: 

https://docs.looker.com/exploring-data/visualizing-query-results/table-next-options#limit_displayed_...

Also, you may possibly use the percent_of_total measure https://docs.looker.com/reference/field-reference/measure-type-reference#percent_of_total instead of table calculation

Top Labels in this Space
Top Solution Authors