Forum Discussion
Rank recurring payment dates per order id (consecutive dates)
- 2 years ago
Hi Glennboy
You can use this DAX formula to rank payments. It resets the rank to 1 if there is no payment date for the same order on the previous day, and increments the rank for consecutive payments accordingly:
Pay Sequence =VAR CurrentOrder = 'Payments'[Order id]VAR CurrentDate = 'Payments'[Pay Date]VAR PreviousDate =CALCULATE(MAX('Payments'[Pay Date]),FILTER('Payments','Payments'[Order id] = CurrentOrder &&'Payments'[Pay Date] < CurrentDate))RETURNIF(DATEDIFF(PreviousDate, CurrentDate, DAY) = 1,CALCULATE(COUNTROWS('Payments'),FILTER('Payments','Payments'[Order id] = CurrentOrder &&'Payments'[Pay Date] <= CurrentDate)),1)Please see, if this is what you want.
Best Regards,
Muhammad Yousaf
If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
Hi Glennboy
You can use this DAX formula to rank payments. It resets the rank to 1 if there is no payment date for the same order on the previous day, and increments the rank for consecutive payments accordingly:
Please see, if this is what you want.
Best Regards,
Muhammad Yousaf
If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.