One of our clients is currently asking to change the default Dynamics AX Payroll Reports—PayrollRegisterSummary as it counts twice in the Total Amount if employee has two same payment methods in the data (e.g. Direct Deposit).
If we open the Payroll Register Summary report and check the Count value expression, it counts the total number of the payment method (e.g. Direct Deposit).
The default code is as below:
="Total " & Fields!PAYMENTMETHODCODE.Value & ":" =Count(Fields!PAYMENTMETHODCODE.Value)
In order to modify the count value, we need to change the object to count. In our implementation, we change the PAYMENTMETHODCODE to EMPLOYEEID. After that, they still count the employee twice if they have two same payment method codes.
To avoid this, we need to change the Count method to CountDistinct which can be used to ignore the same value.
After changing the expression to =CountDistinct(Fields!EMPLOYEEID.Value), we can get the correct value in the Payroll reports.