Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
InsightSeeker
Helper III
Helper III

Calculated Column

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_DateInv_NoDocumentSale_AmountInv_AmountPaid_Amount
1-Jul-238675587575657871200.00             2,510                2,510
20-Jul-2386755875777886861310.00                    -                         -  
3-Jul-2377880787686863210.00             6,770                3,210
9-Jul-2377880776576573560.00                    -                         -  
16-Jul-2377904956998793910.00             3,910                3,910
17-Jul-237791708678684260.00             4,260                4,260
1 ACCEPTED SOLUTION
_AAndrade
Resident Rockstar
Resident Rockstar

Hi @InsightSeeker,

I'm attaching a pbix file with my solution.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

3 REPLIES 3
_AAndrade
Resident Rockstar
Resident Rockstar

Hi @InsightSeeker,

I'm attaching a pbix file with my solution.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Arul
Super User
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)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.