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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
EZV12
Helper IV
Helper IV

Display the same calculated amount for each line within the same invoice in a table

Hello all,

I need help for a formula within a table. 

This table is called "FactInvoicePayment", there are many invoices inside and each invoice has many invoice lines.  I have the amount of each invoice line, but the payment is a total amount for the invoice. Now I need to deduct the amount of special invoice line marked as "S" under the column "InvLine Type" from the total payment, and the calculated amount should be displayed beside each invoice line under the same invoice.

Thanks in advance.

2 REPLIES 2
amitchandak
Super User
Super User

@EZV12 , You can get invoice amount on each line like

 

new column = sumx(filter(Table, [Invoice] = earlier([Invoice]) ), Table[Amount] )

 

measure

measure = sumx(filter(allselected(Table), [Invoice] = max([Invoice]) ), Table[Amount] )

 

or

 

measure = sumx(filter(all(Table), [Invoice] = max([Invoice]) ), Table[Amount] )

 

or

 

measure = sumx(filter(all(Table [Invoice]), [Invoice] = max([Invoice]) ), Table[Amount] )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you for your reply, however, it doesn't work.

What I need is to deduct the amount of special invoice line marked as "S" under the column "InvLine Type" from the total payment (column "Payment", same amount for each invoice line under the same invoice), and the calculated amount should be displayed beside each invoice line under the same invoice.

May you please advise? Thanks

Thanks in advance.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.