Forum Discussion
How to recode date by M code when user data entry mistake ?
Hi Anonymous , please refer to the image below.
Best regards,
Jing
Hi Jing
That is good suggestion. in case one of the invoice sales staff enter the wrong date , and this date we have 20 invoice , how to change the date link to invoice numner ?
Paul
- v-jingzhang5 years agoCommunity Support
Anonymous With this replace values function, it will replace all the same wrong date in the selected date column with the correct one no matter what invoices they are linked to.
Jing
- Anonymous5 years agoNot applicable
Hi Sir
Assume today on 04/11/2020 , there are 100 invoice , and one of the invoice date error entry enter as 11/04/2020 , and during 11/04/2020 which is april , also have 1-- invoice , will all also change to 04/11/2020 ?
Paul
- v-jingzhang5 years agoCommunity Support
Yes, it will replace everything.
If you want to replace the specific linked to an invoice number, you can add the following M code in the Advanced Editor. Remember to change the names of the steps in the M code based on the names of the steps.
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [date],each if [inv]=110102 and [date]=#date(2030,1,4) then #date(2017,1,4) else [date],Replacer.ReplaceValue,{"date"})Best regards
Jing