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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

AR Ageing Grouping

Dear Everyone..

 

I am making AR Ageing Report & i have three tables.. one is customer details and another customer ledger entyr and third one is Detailed Customer Ledger Entry Table...

 

Customer Table

Customer CodeCustomer Name
Csut 01XYZ 01
Cust 02XYZ 02
Cust 03XYZ 03
Cust 04XYZ 04
Cust 05XYZ 05
Cust 06XYZ 06
Cust 07XYZ 07
Cust 08XYZ 08
Cust 09XYZ 09
Cust 10XYZ 10
Cust 11XYZ11
Cust 12XYZ 12
Cust 13XYZ 13
Cust 14XYZ 14
Cust 15XYZ 15
Cust 16XYZ 16
Cust 17XYZ 17
Cust 18XYZ 18
Cust 19XYZ 19
Cust 20XYZ 20
Cust 21XYZ 21
Cust 22XYZ 22

 

Customer Ledger Entry Table

 

Customer CodePosting DateInvoice NoDue Date
Csut 0131/12/2019IN00000131/12/2019
Cust 0231/12/2019CR00000131/12/2019
Cust 0331/12/2019IN00000231/12/2019
Cust 0431/12/2019CR00000231/12/2019
Cust 0531/12/2019IN00000331/12/2019
Cust 0631/12/2019IN00000431/12/2019
Cust 0731/12/2019IN00000531/12/2019
Cust 0831/12/2019CR00000331/12/2019
Cust 0931/12/2019IN00000631/12/2019
Cust 1031/12/2019CR00000431/12/2019
Cust 1131/12/2019IN00000731/12/2019
Cust 1231/12/2019IN00000831/12/2019
Cust 1331/12/2019CR00000531/12/2019
Cust 1431/12/2019IN00000931/12/2019
Cust 1531/12/2019IN00001030/03/2020
Cust 1631/12/2019IN00001131/12/2019
Cust 1731/12/2019CR00000631/12/2019
Cust 1831/12/2019IN00001231/12/2019
Cust 1931/12/2019CR00000731/12/2019
Cust 2031/12/2019IN00001331/12/2019
Cust 2131/12/2019CR00000831/12/2019
Cust 2231/12/2019IN00001531/12/2019
Cust 2331/12/2019CR00000931/12/2019

 

Detailed Customer Ledger Entry table

 

Posting DateInvoice NoOutstanding AmtCustomer Code
31/12/2019IN000001498.5Csut 01
31/12/2019CR000001-80.5Cust 02
31/12/2019CR000001-80.5Cust 03
31/12/2019CR00000180.5Cust 04
31/12/2019IN0000022313.46Cust 05
31/12/2019CR000002-334.82Cust 06
31/12/2019CR000002-334.82Cust 07
31/12/2019CR000002334.82Cust 08
31/12/2019IN000003354.5Cust 09
31/12/2019IN000004309.6Cust 10
31/12/2019IN0000053447.07Cust 11
31/12/2019CR000003-455.71Cust 12
31/12/2019CR000003-455.71Cust 13
31/12/2019CR000003455.71Cust 14
31/12/2019IN0000064531.34Cust 15
31/12/2019CR000004-577.95Cust 16
31/12/2019CR000004-577.95Cust 17
31/12/2019CR000004577.95Cust 18
31/12/2019IN000007207.77Cust 19
31/12/2019IN0000087102.73Cust 20
31/12/2019CR000005-397.56Cust 21
31/12/2019CR000005-397.56Cust 22
31/12/2019CR000005397.56Cust 23

 

Now i have to calculate two things first is the days left for that i have tried this measure

 

Days Left = VAR A = ADDCOLUMNS(SUMMARIZE('Detailed Customer Ledger Entry','Detailed Customer Ledger Entry'[Customer No_],'Detailed Customer Ledger Entry'[Amount],'Customer Ledger Entry'[Posting Date],'Customer Ledger Entry'[Due Date]), "Overdue Days",DATEDIFF('Customer Ledger Entry'[Due Date],TODAY(),DAY))
VAR B = MAXX(A,[Overdue Days])
Return
B
 
 
then for i made a table by grouping in query editor
 
 
Age GroupShort OrderMinMax
0-30 Days1030
31-60 Days23060
61-90 Days36090
91-120 Days490120
121-150 Days5120150
151-180 Days6150180
181-210 Days7180210
211-240 Days8210240
241-270 Days9240270
271-300 Days10270300
301-330 Days11300330
331-365 Days12330365
365+ Days133653650

 

after that i calculate the age wise calculation & for that i used this measure

 

Receivable Per Group =
CALCULATE( [Outstanding Amt],
FILTER( 'Detailed Customer Ledger Entry',
COUNTROWS(
FILTER( 'Customer Age Group',
[Days Left] >= 'Customer Age Group'[Min] &&
[Days Left] <= 'Customer Age Group'[Max] ) ) > 0 ) )
 
 
but now the problem is that both amounts are different...
 
outstanding amount is different and receivable amount is different...while outstanding amount is correctoutstanding amount is different and receivable amount is different...while outstanding amount is correct
 
outstanding amount is different and receivable amount is different...while outstanding amount is correct
 
Coz i simpley Calculated it by this measure
 
Outstanding Amt = CALCULATE(SUM('Detailed Customer Ledger Entry'[Amount]))
 
 
Can anyone Help please... is there somthing wrong my measures or do i have to calculate it by anyother ways....
 
KIndly Help.

Thanks
Arif
1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Your expected output seems clear but there are some problems that not certain based on your description:

  1. In your sample table and measure formula, seems like the column name is not correspoding, for example, where is the [Amount] column if you created a measure name 'Outstanding Amt'
  2. How did you create a group table in query editor?
  3. In your same table, the due date is basic the same, but in your picture there seems different

 

Could you please consider share a dummy .pbix file for further discussion? Please remember to replace the sensitive message in your file.

 

Best Regards,

Yingjie Li

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.