Forum Discussion

ola1996's avatar
ola1996
Helper I
3 years ago

Aging report - age buskets wrong calculation

Hello, 

I have decided to ask you for help because I already have no more idea for my problem. 

I created a aging report based on my data. The report should have a date slicer so user must to choose aging day and it will show data from the beginning of the earth till choosen date. I added to my report calendar table and make relationship beetween it and posting date with table included customer ledger entries data. 

Then I have created a measure to calculate past due days:

Customer PastDue =
IF (
    MIN ( CustomerLedgerEntries[Due_Date] )
        >= MAX ( 'Calendar'[Date] )
        || ISBLANK ( MAX ( 'Calendar'[Date] ) ),
    0,
    DATEDIFF (
        MIN ( CustomerLedgerEntries[Due_Date] ),
        MAX ( 'Calendar'[Date] ),
        DAY
    )
)
Then I added a aging boxes by measures like: 
Age 1-30
Age 31-60
Age 61-90
Above 90 days
 
DAX measure for 1st group
Age 1 - 30 =

CALCULATE(
    SUM('CustomerLedgerEntries'[Remaining_Amt_LCY]),
    FILTER(
        All('CustomerLedgerEntries'[Remaining_Amt_LCY]),
        [Customer PastDue] >= 1 && [Customer PastDue] < 30
    )
)

My problem is that when I create table I see wrong sum, but in the table with details which I have created amount are good but sum calculated is wrong. Could anyone help me please? 

 

1 Reply