Sum with 2 custom columns

Hi there,

So I'm trying to resolve something kind of simple, but I'm kinda new at metabase
I need to sum two columns that are already customized; these two have their values multiplied by 3, and I need to sum them up.

Mathematically speaking, it would look like this:

Value A - ([Value B * 3] + [Value C * 3])

I've tried doing them separately like
Column to Value B * 3
Column to Value C * 3

But then when I sum them up, it keeps bringing me the wrong value.

Hi @Sayuri
Welcome to Metabase Discuss.

It would be super helpful if you can add the query and or result to this questions.

1 Like

Hi @bayo99,
Thank you for the advice!

I've already solved this issue, and I'll share my solution in case someone else needs it.

I was initially trying with simple multiplications. It worked fine, but when I needed to sum them up, it didn’t work:
image

So, what I did was add COALESCE to "exclude" the results when it was 0:
image

I know it's pretty simple, but that's it :smile:

1 Like