Using PowerQuery I have a column with long RAG descriptions eg "No Significant Issues [Green]" which I want to replace with R, A or G based on the text or leaves as is if not match found.
The following code works for Green but is not replacing the Amber statement. I have copied the text exactly.
= Table.ReplaceValue(#"Reordered Columns",each[RAGQuality],each if [RAGQuality]="No Significant Issues [Green]" then "G" else each if [RAGQuality]="Significant Issues [Amber]" then "A" else [RAGQuality], Replacer.ReplaceText,{"RAGQuality"})
Any help appreciated.