Forum Discussion
kolbra07
6 years agoFrequent Visitor
Changing Customer Payment Behaviours Over Time
We're looking at tracking a change in customer trends over a selected time period , so say they paid using one payment method in January but switched to a different payment method in March . Is there a way that this can be identified in a DAX expression ?
4 Replies
- kolbra07Frequent Visitor
Yes of course so we have data like this :
Customer Payment Date Payment Method
A 8/1/20 Cheque
A 3/3/20 Bank Transfer
So we would like to show that customer A has changed their payment method from Cheque to Bank Transfer .
- az38Community Champion
Hi kolbra07
I still not sure how exactly it should look like but try a measure
Measure = var _curDate = MAX('Table'[Payment Date]) var _prevDate = CALCULATE(MAX('Table'[Payment Date]), 'Table'[Payment Date] < _curDate, ALLEXCEPT('Table', 'Table'[Customer])) var _prevPaymentMethod = CALCULATE(FIRSTNONBLANK('Table'[Payment Method], 1), 'Table'[Payment Date] = _prevDate, ALLEXCEPT('Table', 'Table'[Customer])) RETURN IF(_prevPaymentMethod <> MAX('Table'[Payment Method]) && NOT(ISBLANK(_prevPaymentMethod)), TRUE(), FALSE())