# Calculated field from aggregated and non aggregated values

Hello everyone!
I’m trying to create a simple field using the following formula:

SUM({x})*{y}

But I’m receiving a “Mismatched Aggregation” error.
I’m aware of why this doesn’t work. Is there any workaround so I can make my formula work?

Thx!

can you take the avg of y? You might also look into taking the firstValue / lastValue and paritioning it by y.

firstValue([{y}],[{y} DESC],[{y}])

Then you calculation would be SUM({x}) * firstValue([{y}],[{y} DESC],[{y}])

Or what are you taking to accomplish and what does your data look like?

Hey! Thanks for the quick answer.

About what my data looks like:
My dataset has 1 row for each day in the month.
The X column has a value for each day.
The Y column has a percentage for each day, this column sums up to 1 (100%).

I want to create a new column that returns the daily share of X based on the Y percentage.
What I’m trying to accomplish, in the end, is recalculating X, because the values doesnt correspond to my needs. And revisiting the process that calculates it is a big no.