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.

Solved Solved
0 6 430
1 ACCEPTED SOLUTION

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]
)
)
)

View solution in original post

6 REPLIES 6
Top Labels in this Space