Forum Discussion

Dellis81's avatar
Dellis81
Post Prodigy
2 years ago

sumX

Hello, 

I know this is a simple solution, but after reviewing and testing multiple potential solutions - still not quite there.

Wanting to calculate the time interval buckets for an AR/AP aging report.   I have a measure that appears to be working correctly at the invoice level, but when summing to the vendor or grand total level, I have a blank.   

This is more most recent version of measure

 

AgingBucket >0 = 
Var Days = 0
//VAR MinBucket = [InvoiceDueDateM]+Days
//Var MaxBucket = minbucket+30
Var VendorTotal = sumx(VALUES(TADConsolidated[Vendor]),

    VAR MinBucket = [InvoiceDueDateM]+Days
    Var MaxBucket = minbucket+30
    Return    SWITCH(TRUE(),
        [MaxDate]>MinBucket&&[MaxDate]<=MaxBucket,[Net Invoice Due TEST],
        BLANK()))
 Return VendorTotal

 

I have also attempted a calculate with a filter for data brackets, but get the error - SumX does not allow for boolean values, thus I found a reference of using a switch statement to work around.

 

I truly appreciate the Forum's generosity!

2 Replies