Forum Discussion
Anonymous
6 years agoNot applicable
[Advanced Editor] Conditional Concatenate
Hi All, I'm having trouble with what's supposed to be a simple piece of M-script. I want to make a concatenate column. Here is what my data looks like: Division Facility Item A ...
- 6 years ago
Hi Anonymous
Try the below script
#"Added Custom" = Table.AddColumn( Source, "Custom", each [Division] & ( if [Facility] = "-" then "" else [Facility] ) & [Item], type text )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
AlB
Community Champion
6 years agoHi Anonymous
You only need "each" at the beginning. "each" is actually syntax sugar for
(_)=>
i.e., the heading of a function with input parameter called "_". You can find an excellent explanation here:
https://www.excelguru.ca/blog/2018/01/09/each-keyword-power-query/
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Anonymous
6 years agoNot applicable
Thank you for the additional info, I'll have a look at the detailed explanation as well!