From what I see that you have made your expression extremely complex which can be resolved to just this for table or kpi object
=Sum(Aggr(If(Sum([Residual Receivables]) >= Sum(Sales), Avg([#Days]), Avg([Residual Receivables])/Avg(Sales)*Avg([#Days])) , Month,Month_Lookback))
Is this what you wanted to get?
Yes, but on selection of a month, the values need to first sum up based on month_lookback. Then a simple calculation needs to be performed, which has to be summed up based on the month.
Also the expression you posted is yielding 0 in a KPI object.
Thank you once again.
This has been achieved in a table but the same needs to be achieved in a KPI and Bar chart and also a table, but without making use of the month_lookback as a dimension.
Please let me know if this can be achieved.