Forum Discussion
mrleijzer
6 years agoHelper I
Predict payment date
Hello, I'm trying to get to predict when invoices are paid using average payment days per customer. I found a topic just like it: https://community.powerbi.com/t5/Desktop/Forecasting-payment-...
- 6 years ago
Hi mrleijzer
As for the thread
my solution is as below, please check if my measures can work better on your example.
Meausres:
days = IF ( NOT ( ISBLANK ( MAX ( [Payment date] ) ) ), DATEDIFF ( MAX ( [Invoice date] ), MAX ( [Payment date] ), DAY ) + 1 ) average = AVERAGEX(FILTER(ALLSELECTED('Table'),[Customer]=MAX([Customer])),[days]) expected date = IF(ISBLANK(MAX([Payment date])),MAX([Invoice date])+[average])Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
6 years agoCommunity Support
Hi mrleijzer
As for the thread
my solution is as below, please check if my measures can work better on your example.
Meausres:
days =
IF (
NOT (
ISBLANK (
MAX ( [Payment date] )
)
),
DATEDIFF (
MAX ( [Invoice date] ),
MAX ( [Payment date] ),
DAY
) + 1
)
average = AVERAGEX(FILTER(ALLSELECTED('Table'),[Customer]=MAX([Customer])),[days])
expected date = IF(ISBLANK(MAX([Payment date])),MAX([Invoice date])+[average])
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- mrleijzer6 years agoHelper I
Thanks! With a little tweaking I got it to work!