Forum Discussion

bhelou's avatar
bhelou
Responsive Resident
5 years ago
Solved

Receivable Days aging Dynamic

Hello ,
I Have receivalbles aging to do , i have made measures for the days still not yet received , now i am trying to make aging 30 - 90 - 180 - 360 - 720 etc ...  for it as from the days shown , when i am trying the dax : Max is not accepting saying : The MAX function only accepts a column reference as the argument number 1.

 

Invoices : is a measure of the total invoices
Balance is:  Invoices - Payments

 

FORMULA FOR DAYS ( WORKING )  : 

Receivable Days = IF([Status] = "Paid" , 0 , FORMAT( TODAY() - [Invoice Date], "General Number"))

 

 

Formula  FOR AGING ( NOT WORKING ) : 

Receivable Days 30 =

var getdays = IF(MAX([Receivable Days]) <=30,[Receivable Balance],BLANK())

Return

getdays

 

Thank you for your usual help ,


Attached Sample

 



 

  • bhelou , If it is column 

    calculate([Receivable Balance], filter(Table,Table[Receivable Days]<=30))

     

    In case it is a measure

    IF(([Receivable Days]) <=30,[Receivable Balance],BLANK())

  • bhelou , Create like


    Receivable Days =  IF([Status] = "Paid" , 0 , datediff( [Invoice Date],TODAY(), day))

4 Replies

  • bhelou , If it is column 

    calculate([Receivable Balance], filter(Table,Table[Receivable Days]<=30))

     

    In case it is a measure

    IF(([Receivable Days]) <=30,[Receivable Balance],BLANK())

    • bhelou's avatar
      bhelou
      Responsive Resident

      I KNOW  i have tried it , it wont work and even if i wirte it as simple to test it out :

      Receivable Days 30 =
      IF(([Receivable Days]) <=30 , "True","False")  //  it is giving all false , i think it is from the measure of the Receivable days : 
      Receivable Days = IF([Status] = "Paid" , 0 , FORMAT( TODAY() - [Invoice Date], "General Number")) // i dont now if it is acurate , please help amitchandak  many thanks 




       

       

      • amitchandak's avatar
        amitchandak
        Super User

        bhelou , Create like


        Receivable Days =  IF([Status] = "Paid" , 0 , datediff( [Invoice Date],TODAY(), day))