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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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

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

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.