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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

The value of invoices collected in the next 12 months from report date

Hello 

Please help me, if possible with a solution for this case:

I have a table called "account balance" where i have all the invoices with due date less and greater than 90 days.I also have a table with all invoices collected in the next 12 months called collections (seccond table).

I want to calculate for each interval the sum of the invoices collected in the next 12 months from report date and brign the values into a main table linke in the table below where 400 is the value of invoice A+C and 250 the value of invoice D

Report Amount collected for invoices greater than 90 days
1/10/2020              400  
1/11/2020              250 

Account balance

Report dateInvoice number<90 days> 90 days
1/10/2020Invoice A0100
1/10/2020Invoice B2000
1/10/2020Invoice C0300
1/10/2020Invoice D0250
1/10/2020Invoice E0310
1/11/2020Invoice A0100
1/11/2020Invoice K0120
1/11/2020Invoice C0300
1/11/2020Invoice D0250

 

Collections

Collection dateInvoice numberCollected value
6/15/2020Invoice A100
7/18/2020Invoice X90
9/18/2020Invoice Y120
11/18/2020Invoice C300
3/11/2021Invoice Z250
ETCETCETC
ETCETCETC
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check:

Collected value Measure = 
 CALCULATE (
    SUM ( COLLECTION[Collected value] ),
    FILTER (
        'COLLECTION',
        COLLECTION[Collection date] <= EOMONTH ( MAX ( BALANCE[Report date] ), 12 )
            && COLLECTION[Invoice] IN VALUES ( BALANCE[Invoice] )
    )
)
Number of Collected invoices = 
COUNTROWS (
    DISTINCT (
        SUMMARIZE (
            FILTER (
                'COLLECTION',
                COLLECTION[Collection date] <= EOMONTH ( MAX ( BALANCE[Report date] ), 12 )
            ),
            [Invoice]
        )
    )
)
Collected invoices = 
CONCATENATEX (
    DISTINCT (
        SUMMARIZE (
            FILTER (
                'COLLECTION',
                COLLECTION[Collection date] <= EOMONTH ( MAX ( BALANCE[Report date] ), 12 )
            ),
            [Invoice]
        )
    ),
    [Invoice],
    ", "
)

Icey_0-1645498441190.png

Icey_1-1645498485371.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Could you share some details to help me understand your calculation logic?

 

1. For "Report" 1/10/2020, is the expected result "400" the sum of the two lines highlighted below?

Icey_0-1645412101443.png


2. There is no record for "Invoice D" in "Collections" table, how do you get the result of "250"?

Icey_1-1645412138503.png


3. How do you determine whether the "Collections" belonged to "Report" 1/10/2020 or "Report" 1/11/2020?

For example, why can't 400 be calculated on "Report" 1/11/2020 instead of 1/10/2020?

 

 

Best Regards,

Icey

Anonymous
Not applicable

Hello Icey

For first question - yes, the amount expected is 400.

I will try to clarify through this picture where i think i explaind better.

What i need is to check for each month , which documents were collected within 12 months from the report date.

If at 31.01.20219 i had 5 invoices in account balance and 2 of them were collected in march and april 2019  and the rest of 3 in march 2020, the report should sum only the 2 invoices collected in 2019.

The same operation  for 28.02.2019.Check which invoices present at 28.02.2019 in account balance were collected in a 12 month period.

The final result should be a table with a centralization of the amounts.

Thank youPicture5.png

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check:

Collected value Measure = 
 CALCULATE (
    SUM ( COLLECTION[Collected value] ),
    FILTER (
        'COLLECTION',
        COLLECTION[Collection date] <= EOMONTH ( MAX ( BALANCE[Report date] ), 12 )
            && COLLECTION[Invoice] IN VALUES ( BALANCE[Invoice] )
    )
)
Number of Collected invoices = 
COUNTROWS (
    DISTINCT (
        SUMMARIZE (
            FILTER (
                'COLLECTION',
                COLLECTION[Collection date] <= EOMONTH ( MAX ( BALANCE[Report date] ), 12 )
            ),
            [Invoice]
        )
    )
)
Collected invoices = 
CONCATENATEX (
    DISTINCT (
        SUMMARIZE (
            FILTER (
                'COLLECTION',
                COLLECTION[Collection date] <= EOMONTH ( MAX ( BALANCE[Report date] ), 12 )
            ),
            [Invoice]
        )
    ),
    [Invoice],
    ", "
)

Icey_0-1645498441190.png

Icey_1-1645498485371.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hello 

First, than you for response.

The measure works fine but i encountered a problem and i don't know how to solve it

If in "invoice column" of "Balance" or "Collection" a duplicate value it is found the error from the picture appear.The problem is that i cannot have an one to one relation between these tables because the invoices, if uncollected will apear in each month in account balance , and in the collection table , a document can be collected partially in different dates.

Thank you error3.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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