Summing Rows that meet certain conditions

Hey Everyone,

I have a table full of rows and Im trying to get the sum of rows that are related to other rows.

This is my formula right now.

SUM(
SELECT(
Wrapper Leg 1[Leg #1 Counter],
AND(
([Date] = This_[Date]),
([CustomerType] = [CustomerType])
),TRUE
)
)

Im trying to get the sum of rows from the Leg 1 counter that have the same Date and customer Type.

Its either adding all the rows together or just throwing me errors. Ive tried many things.

Ive also tried this,

This doesn’t work either, still adding up all rows for some items, and none for others.

SUM(
SELECT(
Wrapper Leg 1[Leg #1 Counter],
AND(
[Date] = [_THISROW].[Date],
[CustomerType] = [_THISROW].[CustomerType]
)
)
)

Because of a quirk with the is-equal-to operator (=), it may make a difference which operand is on the left and which is on the right. Try this:

SUM(
SELECT(
Wrapper Leg 1[Leg #1 Counter],
AND(
[_THISROW].[Date] = [Date],
[_THISROW].[CustomerType] = [CustomerType]
)
)
)

Same Results. :(.

Adding all rows for some items and giving an output of 0 for others.

Are you willing to share a screenshot of a sample of the Wrapper Leg 1 spreadsheet?

1 Like

Its working Steve.!! , Cant believe it but just realized I was calling the wrong table. Thanks for pointing that out. man. :joy:

1 Like