Podcast
Questions and Answers
What keyword should begin a let expression in M Code?
What keyword should begin a let expression in M Code?
Variables defined in a let expression can be used outside of that expression.
Variables defined in a let expression can be used outside of that expression.
False
What is the syntax to represent a null value in M Code?
What is the syntax to represent a null value in M Code?
null
In a let expression, each variable is followed by a ______ which allows the let statement to deliver intermediate values.
In a let expression, each variable is followed by a ______ which allows the let statement to deliver intermediate values.
Signup and view all the answers
Match the following terms with their definitions:
Match the following terms with their definitions:
Signup and view all the answers
What is the expected last keyword in a let expression?
What is the expected last keyword in a let expression?
Signup and view all the answers
The output of a query in a let expression must be the identifier of the last query step.
The output of a query in a let expression must be the identifier of the last query step.
Signup and view all the answers
What comment syntax is used for multi-line comments in M Code?
What comment syntax is used for multi-line comments in M Code?
Signup and view all the answers
Which tool dramatically improved the ability to clean, transform, and load data from different sources?
Which tool dramatically improved the ability to clean, transform, and load data from different sources?
Signup and view all the answers
Power Query is only available in Excel and cannot be used with Power BI.
Power Query is only available in Excel and cannot be used with Power BI.
Signup and view all the answers
What programming language is used to create Power Query queries?
What programming language is used to create Power Query queries?
Signup and view all the answers
The M in M Code stands for __________.
The M in M Code stands for __________.
Signup and view all the answers
Match the following Microsoft tools with their functionalities:
Match the following Microsoft tools with their functionalities:
Signup and view all the answers
What kind of language is M Code described as?
What kind of language is M Code described as?
Signup and view all the answers
PivotTable was the preferred method for summarizing data before PivotTable was available.
PivotTable was the preferred method for summarizing data before PivotTable was available.
Signup and view all the answers
In what year was Power BI Desktop invented?
In what year was Power BI Desktop invented?
Signup and view all the answers
What should happen if the splitter function returns more columns than the table expects and ExtraValues.Error is set?
What should happen if the splitter function returns more columns than the table expects and ExtraValues.Error is set?
Signup and view all the answers
The default encoding type when saving a CSV file is UTF-8.
The default encoding type when saving a CSV file is UTF-8.
Signup and view all the answers
What encoding type corresponds to 1252?
What encoding type corresponds to 1252?
Signup and view all the answers
The option ExtraValues.Ignore is useful when you want to omit extra columns and avoid getting an ________.
The option ExtraValues.Ignore is useful when you want to omit extra columns and avoid getting an ________.
Signup and view all the answers
How many parameters can be specified in the columns argument record for importing text files?
How many parameters can be specified in the columns argument record for importing text files?
Signup and view all the answers
Match the following encoding types with their identifiers:
Match the following encoding types with their identifiers:
Signup and view all the answers
The QuoteStyle.None option means that quoted line breaks are kept.
The QuoteStyle.None option means that quoted line breaks are kept.
Signup and view all the answers
A delimiter can be specified in a record like: Delimiter=_____ for a tab.
A delimiter can be specified in a record like: Delimiter=_____ for a tab.
Signup and view all the answers
What is the main purpose of the Csv.Document function?
What is the main purpose of the Csv.Document function?
Signup and view all the answers
The delimiter argument in the Csv.Document function can only accept a single character.
The delimiter argument in the Csv.Document function can only accept a single character.
Signup and view all the answers
Name one file format that the source argument of Csv.Document can accept.
Name one file format that the source argument of Csv.Document can accept.
Signup and view all the answers
The _______ argument allows you to specify which columns to import using null to import all columns.
The _______ argument allows you to specify which columns to import using null to import all columns.
Signup and view all the answers
Match the following components of the Csv.Document function with their definitions:
Match the following components of the Csv.Document function with their definitions:
Signup and view all the answers
Which of the following characters is NOT accepted as a special delimiter in Csv.Document?
Which of the following characters is NOT accepted as a special delimiter in Csv.Document?
Signup and view all the answers
The extraValues argument has no effect on how columns are skipped in the Csv.Document function.
The extraValues argument has no effect on how columns are skipped in the Csv.Document function.
Signup and view all the answers
What happens if you omit the columns argument in the Csv.Document function?
What happens if you omit the columns argument in the Csv.Document function?
Signup and view all the answers
What does subtracting one date from another yield in M Code?
What does subtracting one date from another yield in M Code?
Signup and view all the answers
In M Code, you can merge a date value and a time value using the addition operator.
In M Code, you can merge a date value and a time value using the addition operator.
Signup and view all the answers
What is the intrinsic function used in M Code to hard code a time value?
What is the intrinsic function used in M Code to hard code a time value?
Signup and view all the answers
A datetime value in M Code is represented as a serial number that combines the number of days since _______ and the decimal amount of a 24 hour day.
A datetime value in M Code is represented as a serial number that combines the number of days since _______ and the decimal amount of a 24 hour day.
Signup and view all the answers
Match the following intrinsic functions with their purposes:
Match the following intrinsic functions with their purposes:
Signup and view all the answers
Which statement regarding time values in M Code is correct?
Which statement regarding time values in M Code is correct?
Signup and view all the answers
The join operator is used in M Code to combine a date and a time value.
The join operator is used in M Code to combine a date and a time value.
Signup and view all the answers
Which operator can be used to offset a time value with a duration?
Which operator can be used to offset a time value with a duration?
Signup and view all the answers
What is the primary use of a left outer join?
What is the primary use of a left outer join?
Signup and view all the answers
The custom function in M Code can use variables that contain spaces.
The custom function in M Code can use variables that contain spaces.
Signup and view all the answers
What operator is used to indicate the mapping of variables in a custom function?
What operator is used to indicate the mapping of variables in a custom function?
Signup and view all the answers
In M Code, the _____ function is similar to Excel's LAMBDA function.
In M Code, the _____ function is similar to Excel's LAMBDA function.
Signup and view all the answers
Which of the following statements is true about left anti joins?
Which of the following statements is true about left anti joins?
Signup and view all the answers
Match the following M Code elements with their descriptions:
Match the following M Code elements with their descriptions:
Signup and view all the answers
Functional value types are mandatory when creating a custom function in M Code.
Functional value types are mandatory when creating a custom function in M Code.
Signup and view all the answers
What must be used to create a comment in M Code?
What must be used to create a comment in M Code?
Signup and view all the answers
The left outer join is the most _____ type of join used in data transformations.
The left outer join is the most _____ type of join used in data transformations.
Signup and view all the answers
Study Notes
Data Analysis Made Easy with Microsoft Power Tools
- This video covers the fundamentals of M code in Power Query.
- The video is not as in-depth as other resources.
- A book with more details on M code will be published in October 2024.
- This book will contain every detail of M code.
- Power Query is a Microsoft tool for connecting, importing, cleaning, transforming and loading data.
- M Code is a programming language usable in Power Query, Power BI Desktop, and the Power BI Online Service (Dataflow)
Table of Contents
- Key topics are listed, with page numbers indicating where details can be found in the table of contents.
History
- Power Query was introduced in Excel in 2013, 20 years after PivotTables were invented.
- PivotTables are easy to use with correctly structured tables and column names but Power Query allows for data from different sources.
- Power Query improves capabilities to take data from multiple data sources and transforms it into a suitable structure before loading it into Excel.
- Power BI Desktop was invented to make data reporting and visualization easier in 2015.
- Microsoft Power Query is now an embedded tool in Power BI online service and called Dataflow.
Power Query and M Code
- All Power Query queries are written using the M Code programming language.
- M code is described as "Mashup Data".
- M Code is a function-based language for creating values such as tables, lists, numbers, and other data-related values.
- M Code complements and works alongside other Microsoft function-based languages like worksheet formulas, Standard PivotTables and Data Model DAX formulas.
M Code as Compared to Other Three Functional Languages
- Worksheet formulas can link to any cell, range, column, or table, unlike M Code, Standard PivotTables and DAX formulas.
- Standard PivotTables are fast and efficient for summing, counting, and calculating percentages.
- DAX Formulas are powerful for working with big data because they can create tables at various grains inside DAX formulas.
- Worksheet formulas instantly update when the data changes, but other languages don't have this feature.
User Interface & M Code, Three Places to Edit M Code
- M Code can be edited in the Applied Steps, Formula Bar and Advanced Editor.
Expression
- An expression is any M code that results in a value.
- Examples include functions like
Table.ColumnNames(TableName)
, lists, numbers, query steps within alet
expression and a fulllet
expression itself.
M Code Values
- Values, with descriptions, are listed.
e.g., Null, Logical, Text, Number, Time, Date, Datetime, Datetimezone, Duration, Table, Record, List, Binary, Function and Type.
Type Values and Data Description
- Data types in M code. (e.g. Decimal number, Currency, Percentage, Date time, Duration, Text, True/False, Binary, Any, nullable.)
- Data types are used as safeguards to deliver consistent results in calculations in M Code.
Operators, Values and Data Types
- Operators in M Code are shown in a table.
- Precedence and type compatibility are important considerations.
- Operators for different data types vary.
Identifiers and Keywords
- Keywords and identifiers are used in M code.
- Examples of keywords are
let
andin
. - Identifiers act as names for expressions in M Code
Let Expression
-
let
expression lets you define and use variables (query steps) that deliver a final query value.
Null Value
-
null
represents the absence of a value. It can be used in operators, but the result is alwaysnull
.
Logical Values
- Boolean values (true/false).
- Operators for logical values (e.g greater than >, less than <).
Text Values
- Text values are strings of Unicode characters.
- The syntax for text values. (e.g. "Quad").
Number Values
- M code number values.
- The literal syntaxes for different number values.
Date, Time, Datetime, Datetimezone and Duration
- The different date and time related values in M code, including intrinsic functions for setting these values
- Examples of date, time functions and data type conversions.
Table, Records, and Lists
- Data structures in M Code, including Tables, Records, and Lists.
- How to work with these data structures to perform data analysis.
List Value
- List values are sequences of M Code values.
- Lists can contain a combination of different data types.
Record Value
- Records can hold several pieces of information in an organised way.
- The structure, like the column names in a table, but for a single row.
- Records can be extracted from tables.
Table Value
- Tables are structured to hold column names and multiple values.
- They structure data as rows and columns and can be used in M code calculations.
Binary Value
- Binary values represent a sequence of bytes
- Used to represent various file types like Excel files, text, images etc.
M Code Lookup Formulas
- There are exact match and approximate match lookup formulas.
- How these lookups are performed in M Code, and how they are different from worksheet (e.g., INDEX) functions.
Table.Buffer
- The Table.Buffer function stores tables in memory.
Table.Group
- Functions for grouping data in given tables.
- The types and arguments of the function.
Comparer Functions
- Functions used to determine equality and compare values.
Custom Function Value
- Function values (custom functions) in M Code
- The declaration and use of variables in custom functions.
- Examples and syntaxes of custom functions.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on let expressions in M Code. This quiz covers topics such as syntax for null values, variables usage, and multi-line comments. Challenge yourself to match terms with their definitions and answer questions about let expression structure.