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

Get Fabric Certified for FREE during Fabric Data Days. 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
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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors