Data Sources

M Source Data

Loading Source Data

M source data loads from Excel CSV or databases.

Introduction to M Source Data

In Power Query, M is a powerful language used for data transformation and manipulation. One of the primary uses of M is to import data from various sources such as Excel, CSV files, and databases. This guide will help you understand how to load data using M, with practical examples.

Loading Data from Excel Files

Excel files are among the most common sources of data. To load data from an Excel file, you can use the Excel.Workbook function. This function reads the content of the Excel file and returns it as a table, which can then be transformed and manipulated.

Example:

Loading Data from CSV Files

CSV files are another popular data source. M provides the Csv.Document function to load data from CSV files. This function takes the file content and parses it into a table format.

Example:

Loading Data from Databases

Databases are often used for storing large volumes of data. M can connect to various databases such as SQL Server, MySQL, and others using the appropriate connectors. For SQL Server, you can use the Sql.Database function.

Example:

Conclusion

Loading data into Power Query using M is straightforward once you understand the basic functions and their parameters. Whether you are dealing with Excel, CSV files, or databases, M provides versatile tools to help you get started quickly and efficiently. In the next post, we will dive deeper into loading data specifically from Excel sources.

Previous
Tables