This recipe computes a simple percentage of the number of customers in the current step of the process versus the number of customers in the previous step of the process. To accomplish this, the first line gets the current step of the process in context and stores this value in the __CurrentStep variable. The next line computes the previous step of the process and stores this in the __PreviousStep variable. Note that in this recipe, the steps have been numbered and thus it is simple to compute the identity of the previous step. In more complex data models, this computation may need to have increased complexity and involve an IF, SWITCH, or even LOOKUPVALUE DAX function.
Once the current and previous steps are identified, the number of customers that made it to the current step of the process are computed using the COUNTROWS DAX function and stored in the __CurrentCount variable. The number of customers in the previous process, __PreviousCount, is computed by first checking to see whether __CurrentStep is 1. In this case, there is no previous step of the process, so __PreviousCount is set to 0. Otherwise, the number of customers in the previous step can be computed by using FILTER combined with ALL to filter all of the rows in the table that are identified as the previous step and then using COUNTROWS to determine the number of customers.
Once the counts of customers are computed, the DIVIDE function is used to calculate a simple percentage of the customers in the previous step that did not make it to the current step.