Over the past couple of weeks, I have been working on a project where I was required to build a #PowerBI connector for an API.
I have to say, this is an interesting experience, because I was learning a new language in the process. Welcome to the M language. #DataModeling
🧵
M Language, stands for Data Mashup or Data Modelling language, is a very simple but powerful modelling language.
Basically, M language takes input data, model it, and exports it.
Let's look into the simplest M language "let" block.
"Let" is a block used for data modelling. Basically it starts with the famous "let" keyword. Which is similar to "let" in Javascript; it basically defines a variable.
In the previous example, we created a dictionary called "source" (for data source), which defines first and last names
"let" statements are comma separated, and evaluated sequentiall. That means you can do something like that.
This basically, adds a new variable called #"First Name", and assigns it the value of the "First Name" from the source dictionary.
Did you notice how you can have variables with spaces 😱
Yes, that's true, you can call a variable anything, as long as you precede it with # character, and encapsulate it in double quotes.
#"This is an acceptable variable name in M language"
Finally, the last part and the most confusing part. The "in" keyword.
In M language, you can consider "in" as "output".
So the output of this "let" statement, is the #"First Name", or "Mina"
Was that helpful to you?
Let me know your thoughts in comments, also, feel free to add any additional knowledge.
Do you like more information about M language and building Power BI connectors?
• • •
Missing some Tweet in this thread? You can try to
force a refresh