Forum Discussion

Deelip's avatar
Deelip
Icon for Resolver I rankResolver I
1 year ago
Solved

Dynamic calculations based on the selected date

Hi All,  I cannot think of an approach for my requirement on finding the outstanding amounts/number of days due based on the user selection.   I have the following table and with the expected outp...
  • ryan_mayu's avatar
    1 year ago

    Deelip 

    you can try this

     

    Total AR =
    VAR _date=max('date'[Date])
    return sumx(FILTER(all('Table'),'Table'[Customer]=max('Table'[Customer])&&('Table'[Closed at Date]>_date||ISBLANK('Table'[Closed at Date]))),'Table'[Amount])
     
    not due =
    VAR _date=max('date'[Date])
    return sumx(FILTER(all('Table'),'Table'[Customer]=max('Table'[Customer])&&'Table'[Due Date]>_date),'Table'[Amount])
     
    1-30days =
    VAR _date=max('date'[Date])
    VAR _tbl=ADDCOLUMNS('Table',"days",'Table'[Closed at Date]-_date)
    return sumx(FILTER(_tbl,'Table'[Customer]=max('Table'[Customer])&&[days]>0 &&[days]<=30),'Table'[Amount])
     
     
     
     
    pls see the attachment below