M language

M language is a mashup query language for Power Query. M code is the language behind the scenes of power query. When you create a data transformation in the power query editor UI, Excel is writing the corresponding M code for the query.
M is functional, case sensitive language which means it is primarily written with called to evaluate and return results. M code comes eith very large library of predefined functions available and you can also create your own.


M language Syntax
First, you should know that the M language is case sensitive language, where the capital letter differ from the small letter.
M language has two main blocks let and in.
- let is used to define variables
- in is used to display output

let
    x=1 variable definition
in
    x output

Make sure let and in all lower case. Also your variable name should be the same case in both blocks.
There is no need to define data types for variable, it will be automatically assigned when the first assignment occurs.


let
    x=1
    y=x*5
    #"This is a variable name"=y+5

in
    #"This is a variable name"

About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext