cancel
Showing results for
Did you mean:
Helper I

## Sum by ID

Hi guys!

Can anybody help me?

I have a table with my sales (Vendas table).  These sales can be received in installments (Column Qtde de Parcelas)

I have another Receipts table (Table Recebimentos). It contains all payments made from sales.

I need to check if the sale was received, so I created a new table performing a merge between the ID.

When I perform the sum of the GROSS VALUE column (column VALOR BRUTO), it adds up all the lines, which is the amount of installments that the sale has. How could I perform this sum by ID?

As a final result I would like to check if the total amount of the sale has already been paid or if there are still open installments

1 ACCEPTED SOLUTION
Helper I

Why don't you switch to a DAX Measure? If I were you I'd proceed this way:

- Start with setting up the relationship on Stone ID (apparenty 1 to Many from Vendas to Recebimientos)
- In a table (or matrix) visual, add:

• Stone ID
• Total = SUM(Vendas[Valor Bruto])
• Total_Paid = SUM(Recebimientos[Valor Bruto])
• Open_Amount = Total - Total_Paid

3 REPLIES 3
Solution Sage

Hi @kafreitass ,

try this measure

SUMX(
SUMMARIZE(
'Facts',
'Facts'[STONE ID],
'Facts'[VALOR BRUTO]
),
'Facts'[VALOR BRUTO]
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Helper I

Why don't you switch to a DAX Measure? If I were you I'd proceed this way:

- Start with setting up the relationship on Stone ID (apparenty 1 to Many from Vendas to Recebimientos)
- In a table (or matrix) visual, add:

• Stone ID
• Total = SUM(Vendas[Valor Bruto])
• Total_Paid = SUM(Recebimientos[Valor Bruto])
• Open_Amount = Total - Total_Paid

Helper I

@JulienZH I made it this way and it worked really well. Thanks

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors