How about a calculated field with a formula of:
and then ensure your Partitioning is the Customer Dimension.
If you can provide a sample packaged workbook that represents your situation more details can be provided, as there may be other subtle factors that are having an impact and need to be taken into consideration.
Thanks Joe Mako
Attached is the worksheet.
Formula for CodeNextValue is:
CALCULATE(sum(Attempts[CodeNumber]), FILTER(Attempts, (Attempts[Customer_ID]=EARLIER(Attempts[Customer_ID])) && (Attempts[AttemptNo]=(EARLIER(Attempts[AttemptNo])+1))))
Note that above "Attempts" is the table name.
In the attached worksheet customer ID 1017504742 has 4 different attempts. I am trying to duplicate creating the CodeNextValue in tableau as is done in Powerpivot.
attempt.xlsx 8.5 KB
Alex, unfortunately I do not know PowerPivot, nor am I able to derive your logic from looking at static numbers.
For example, why is cell F2's value '100'? where did that value come from?
If that cell should really be blank, how about the attached that uses the formula:
code number.twbx 28.3 KB