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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
dechernov
Regular Visitor

Filling invoice amount paid depending on a sum of total payments

Hi all,

 

I am new to Power BI and would like to get a little help with DAX expression. I have two tables which have no relationships between them: “Invoices” and “Payments made”. I want to create a column called “Paid amount” in the first table which calculates if we can pay a full amount of invoice or a part depending on a total sum of payments made and puts corresponding value. It seems that I should use rolling sums, but I stucked at developing a logic of an expression. Both tables involve updating. Anyone who can help me is very grateful.

“Invoices” table looks like this:

dechernov_0-1687420403139.png

“Payments made” table looks like this:

dechernov_1-1687420452486.png

Expected result:

dechernov_2-1687420462830.png

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @dechernov,

I'd like to suggest you write measure formula to lookup and summary table records based on current date values:

 

Rolling Payment=
VAR currDate =
    MAX ( Invoices[Date] )
RETURN
    SUMX (
        FILTER ( ALLSELECTED ( Payments ), Payments[Date] <= currDate ),
        Payments[Paid Amount]
    )

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @dechernov,

I'd like to suggest you write measure formula to lookup and summary table records based on current date values:

 

Rolling Payment=
VAR currDate =
    MAX ( Invoices[Date] )
RETURN
    SUMX (
        FILTER ( ALLSELECTED ( Payments ), Payments[Date] <= currDate ),
        Payments[Paid Amount]
    )

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors