Percent_of_total with filters doubt

Hey guys! I’m a Looker rookie, so this might have a super easy solution that i may not know about yet.

My problem is the following:
I have a measure that is type percent of total, and I’m using it to calculate the percent of total revenue that each product represents in a certain month.
The thing is that when I filter out some products, I want it to still calculate the percent of total over all of the products, not just the ones that appear in the table.

Any ideas??

Thanks in advance!

0 4 819
4 REPLIES 4

Hi,

You have few options:

  1. Calculate the % in your Data Model
  2. Always return all results in Looker and create Table calculation that only shows certain products in your visualisation but your % of total is calculated from all. This calculations would be of a type yesno and then you can click on gear icon in the data table and say “Hide Nos from visualisation”

That means all the data is still in your data layer but the visualisation layer is filtered

Hi Dawid! Thanks for your answer! 🙃
So, I can’t apply the yesno calculation, as my products are pivoted in the table 😑
And I have defined the % in the data model but they still get filtered when I filter the products! Any insights on this? I have calculated the percentage with the percent of total measure… should I do a dimension instead?

I don’t know without seeing some samples. I don’t understand why products are pivoted, for example.

The bottom line is you either have to remove the filter and calculate it in the Data Model, while taking all intricacies of your result into consideration, or no filters at all, use products as dimension, and hide them from the vis

Hi,

You have few options:


  1. Calculate the % in your Data Model
  2. Always return all results in Looker and create Table calculation that only shows certain products in your visualisation but your % of total is calculated from all. This calculations would be of a type yesno and then you can click on gear icon in the data table and say “Hide Nos from visualisation”


  3.  

That means all the data is still in your data layer but the visualisation layer is filtered

Hello Dawid! I am a Looker newbie, and I have the same problem as the author of this topic had. Can you give some examples on how it can be done? I am not sure about “yesno” part. (no pivoting in my case)

Top Labels in this Space
Top Solution Authors