Self joining table

Hi there ,
I have a data like

111

And a calculation which is sum(AmountMst) group by Voucher

112

And would like to have result as below

113
Add Sum column to the result with using Voucher=Voucher

Here is my SQL code which can give you a better idea of what I want to do.
114

How can I achieve this with using a measure?

Thanks.

Hi @saglamtimur,

You can create a measure like:

CALCULATE(SUM(AmountMst), ALL(TABLE[SOL]))

Just need to ignore the SOL column and keep the filter for the others.

Hey

The quickest way would be to add a calculated column to your table. Something like:

=CALCULATE( SUM( 't1'[AmountMst] ) )

This would be useful if you wanted to also filter by this column. Otherwise you could do a measure like @ricardocamargos88 has suggested. Something like:

=CALCULATE( SUM( 't1'[AmountMst] ), ALLEXCEPT( 't1', 't1'[Voucher] ) )

This will give you the total amount per voucher number.

I hope this helps.