In looker studio I am trying to create a column for a table that takes the sum of some values but capped at another value from a different column.
Now the thing is that my dataset has one row telling me the cap for the data and multiple other rows for the count itself.
So the data table will look like:
UID, project, cappingValue, counter,
01, project1, 5, null,
02, project1, null, 4,
03, project1, null, 3
04 project2, 6, null,
05 project2, null, 4
Then I have a table for which i show the capped amount using SUM(capping value) and the total count using sum(counter). then the next column i use a calculated field cappedCount = IF(SUM(cappingValue) > SUM(counter), SUM(Counter), SUM(cappingValue).
Then the row dimension is project thus giving the table
Project 1 : 5 , 7, 5
project 2: 6, 4, 4
now if I add a summary row this gives: total capping: 11, total count: 11 and thus cappedTotal also staying at 11.
However I want the cappedTotal to be per project. thus showing me 9 instead of 11.
How can I achieve this?