Forum Discussion
Customer group split based on stores
- 1 year ago
SamWiseOwl I think I manage to find solution in M code:
Table.ReplaceValue(#"Renamed Columns1",each [Customer Group Description],each if Text.Contains([Store Name], " NI") or [Store Number] ="1378" then "Stores NI" else [Customer Group Description],Replacer.ReplaceText,{"Customer Group Description"})
You could inclue them in the test.
New Column =
Switch(
True()
,[Customer Group Description] <> "Stores UK & NI" --if not this
,[Customer Group Description] --return original value
,ContainsString([Store Name], " NI")
,"Stores NI"
,"Stores UK"
)
SamWiseOwl I think I manage to find solution in M code:
Table.ReplaceValue(#"Renamed Columns1",each [Customer Group Description],each if Text.Contains([Store Name], " NI") or [Store Number] ="1378" then "Stores NI" else [Customer Group Description],Replacer.ReplaceText,{"Customer Group Description"})