Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I need to create a calculated column to determine the total Paid Amount.
From the Payment table, sum the total paid amount for each Invoice (Inv Number) and create a calculated column in the Sale_1 table.
The calculated column should display the total paid amount only for the first sale of the invoice in the Sale_1 table (based on the first unique key). All subsequent sales should show a paid amount of 0.
Attached is the PBIX file for reference. Click Here
Result (Sales_1 Table)
| Inv_Date | Inv_No | Document | Sale_Amount | Inv_Amount | Paid_Amount |
| 1-Jul-23 | 867558757 | 565787 | 1200.00 | 2,510 | 2,510 |
| 20-Jul-23 | 867558757 | 7788686 | 1310.00 | - | - |
| 3-Jul-23 | 778807 | 8768686 | 3210.00 | 6,770 | 3,210 |
| 9-Jul-23 | 778807 | 7657657 | 3560.00 | - | - |
| 16-Jul-23 | 779049 | 5699879 | 3910.00 | 3,910 | 3,910 |
| 17-Jul-23 | 779170 | 867868 | 4260.00 | 4,260 | 4,260 |
Solved! Go to Solution.
Hi @InsightSeeker,
I'm attaching a pbix file with my solution.
Proud to be a Super User!
Hi @InsightSeeker,
I'm attaching a pbix file with my solution.
Proud to be a Super User!
try this,
Sales =
VAR _curInv = 'Table (2)'[Inv_No]
VAR _curDate = 'Table (2)'[Inv_Date]
VAR _paid = CALCULATE(
MAX('Table (2)'[Sale_Amount]),
FILTER('Table (2)','Table (2)'[Inv_Date] = _curDate))
VAR _key = CALCULATE(
MIN('Table (2)'[Unique_Key]),
FILTER('Table (2)','Table (2)'[Inv_No] = _curInv))
RETURN IF('Table (2)'[Unique_Key] = _key,_paid,0)
Hi @Arul - From the Payment table, I need to sum the total paid amount for each Invoice (Inv Number) and create a calculated column in the Sale_1 table. The suggestion which you gave doesnot calcuilate the paid amount from the payment table.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 28 | |
| 26 | |
| 26 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 51 | |
| 49 | |
| 43 | |
| 39 | |
| 36 |