Basics

M Data Types

M Data Types

M data types include text number and date with type inference.

Introduction to M Data Types

M is a powerful, flexible data manipulation language used in Power Query. Understanding its data types is crucial for effective data processing. M supports various data types such as text, number, and date, among others. It also features type inference, which allows the language to automatically determine the type of data you're working with.

Text Data Type

The Text data type in M is used to represent strings of characters. Text data is enclosed in double quotes. It's often used for representing names, descriptions, and other non-numeric information.

Number Data Type

The Number data type is used for both integer and floating-point numbers. M automatically handles the type of number (integer or decimal) depending on the input.

Date and Time Data Types

M offers robust support for Date and Time data types. You can represent just the date, just the time, or both in a single value.

Type Inference

Type inference in M means that the language automatically determines the data type based on the value assigned. This feature simplifies coding by reducing the need for explicit type declarations.

Conclusion

Understanding M data types and their capabilities enhances your ability to process and manipulate data effectively. With automatic type inference, M simplifies many tasks, allowing you to focus on the logic of your data transformations. In the next article, we will explore Type Conversion in M to further enhance your data manipulation skills.

Previous
Variables