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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
omega123
Frequent Visitor

Aggregate table

Hi all.

 

I would like to get one aggregate table from the billing and incoming payments table, where the incoming payments should be assigned to respective contracts and dates (to which the incoming payment refers). I have already asked about a more sophisticated FIFO case (https://community.powerbi.com/t5/Power-Query/Aggregate-table/m-p/2909309#M91722) and received a helpful solution. 

 

Now I have a more simple situation - please see 2 tables below.

A payment of 200 under contract 2 which refers to the date of 19.02.2022 will cover fully the amount of 200 from respective date 19.02.2022 with a due date of 25.02.2022.
A payment of 50 under contract 1 on 26.02.2022 which refers to the date of 02.02.2022 will cover partly the amount of 100 from 02.02.2022 with a due date of 15.02.2022.
A payment of 50 under contract 1 on 27.02.2022 which refers to the date of 02.02.2022 will cover the rest of the amount of 100 from 02.02.2022 with a due date of 15.02.2022.
And so on...

 

I have tried to assign the contract numbers and reference dates, but could not do it. Although it's really a very easy task.

 

I would be very grateful for your help.

 

INITIAL TABLE

 

Date - dailyContract nmbDate to which the incoming payment refersAmount payablePayment deadlineIncoming payment
01.02.2022     
02.02.20221 10015.02.2022 
03.02.20223 20015.02.2022 
04.02.2022     
05.02.20224 40019.02.2022 
06.02.2022     
07.02.2022     
08.02.20222 30022.02.2022 
09.02.2022     
10.02.20225 10024.02.2022 
11.02.2022     
12.02.2022     
13.02.20221 50007.03.2022 
14.02.20221 40010.03.2022 
15.02.2022     
16.02.20223 10017.03.2022 
17.02.20225 80020.03.2022 
18.02.2022     
19.02.20222 20025.03.2022 
20.02.2022     
21.02.2022     
22.02.2022     
23.02.2022     
24.02.2022     
25.02.2022219.02.2022  200
26.02.2022102.02.2022  50
27.02.2022102.02.2022  50
28.02.2022316.02.2022  100
01.03.2022405.02.2022  350
02.03.2022517.02.2022  50
03.03.2022510.02.2022  50
04.03.2022     
05.03.2022     

 

AGGREGATE TABLE

DateContract nmbAmount payablePayment deadlineReceived paymentRemaining amount payable
02.02.2022110015.02.20221000
03.02.2022320015.02.2022 200
05.02.2022440019.02.202235050
08.02.2022230022.02.2022 300
10.02.2022510024.02.20221000
13.02.2022150007.03.2022 500
14.02.2022140010.03.2022 400
16.02.2022310017.03.20221000
17.02.2022580020.03.2022 800
19.02.2022220025.03.20222000
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @omega123

 

I have made it! Please download the attachment to see detailed transformations. 

vjingzhang_0-1670925224668.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

View solution in original post

3 REPLIES 3
omega123
Frequent Visitor

Hello

thank you @v-jingzhang! Now I understand it. That's exactly what I need - payments should be assigned strictly to the specific rows.

 

By the way, I have asked another related question here https://community.powerbi.com/t5/Power-Query/Aggregate-table/m-p/2935558#M92692  - how to take into account the priority of the incoming payment. At first, payments with top priority should be taken into account. Do you know how to do it?

 

Thank you in advance!

v-jingzhang
Community Support
Community Support

Hi @omega123

 

I have made it! Please download the attachment to see detailed transformations. 

vjingzhang_0-1670925224668.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

v-jingzhang
Community Support
Community Support

Hi @omega123 

 

I found contract 5 has two incoming payments with different "Date to which the incoming payment refers", do you want to always aggregate them to the earliest "Date to which the incoming payment refers"? 

vjingzhang_0-1670924095020.png

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors