{"id":176488,"date":"2024-05-02T03:36:48","date_gmt":"2024-05-02T02:36:48","guid":{"rendered":"https:\/\/liora.io\/en\/?p=176488"},"modified":"2026-02-23T13:31:58","modified_gmt":"2026-02-23T12:31:58","slug":"formulas-in-power-query-formulas-the-best-of-them","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/formulas-in-power-query-formulas-the-best-of-them","title":{"rendered":"Formulas in Power Query formulas: The best of them"},"content":{"rendered":"\n<p><strong>Power Query formulas offer a wide range of possibilities for manipulating data in Excel and Power Query. Find out all you need to know about the different types and how to use them&#8230;<\/strong><\/p>\n\n\n\n<p>With <strong>Power Query, Excel and Power BI<\/strong> users can transform, cleanse, combine and query data from multiple sources. Its intuitive interface makes data analysis accessible to as many people as possible. The query editor requires no coding, and this is what <a href=\"https:\/\/liora.io\/en\/power-bi-microsofts-business-intelligence-solution\">makes Business Intelligence so accessible.<\/a><\/p>\n\n\n\n<p>The tool even offers automatic <a href=\"https:\/\/liora.io\/en\/data-cleaning-definition-methods-and-relevance-in-data-science\">data cleansing<\/a> tools for detecting and <strong>removing duplicates,<\/strong> correcting data errors, deleting spaces or normalizing dates. What&#8217;s more,<strong> Power Query<\/strong> also offers automatic data cleansing tools such as duplicate detection and removal, data error correction, space removal, date normalization and more. These tools enable users to clean up data without having to write formulas.<\/p>\n\n\n\n<p>However, to manipulate data more efficiently and accurately, advanced users can use Power Query formulas. These are written in the <strong>M language.<\/strong> These formulas can be used to perform calculations, manipulate text, aggregate imported data or perform other operations such as merging, filtering, sorting or formatting. Powerful and flexible, <strong>Power Query formulas<\/strong> enable you to customize data transformations to suit your specific needs. In this article, you&#8217;ll discover the different categories and how they work!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-the-m-language\">What is the M language?<\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\" style=\"margin-top:var(--wp--preset--spacing--columns);margin-bottom:var(--wp--preset--spacing--columns)\"><img decoding=\"async\" src=\"https:\/\/liora.io\/app\/uploads\/2026\/02\/moniteur-ordinateur-interface-utilisateur-1024x572.jpg\" alt=\"\" style=\"width:1000px;height:auto\" title=\"\" \/><\/figure>\n\n\n\n<p>The <strong>M or Power Query Formula Language<\/strong> is used in Power Query to describe data transformation steps. It is a functional language, based on functions that take arguments and return values. Power Query uses this language to write formulas: expressions describing the data transformations to be performed. It&#8217;s<a href=\"https:\/\/liora.io\/en\/etl-or-extract-transform-load-definition-and-use\"> a powerful tool for ETL and data analysis.<\/a><\/p>\n\n\n\n<p>Its syntax is simple and intuitive, making it easy to learn for people already familiar with other programming languages. The various <strong>M language<\/strong> functions are organized in libraries, grouped by theme and category.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-are-the-text-transformation-formulas\">What are the text transformation formulas?<\/h2>\n\n\n\n<p>Text transformation formulas such as LEFT, RIGHT, UPPER, LOWER, PROPER, SUBSTITUTE, TRIM, CONCATENATE and LEN are used to clean up and<strong> transform text data.<\/strong> They make it easy to manipulate character strings such as names, addresses and telephone numbers. It is also possible to remove unwanted characters such as spaces, hyphens or parentheses.<\/p>\n\n\n\n<p>For example, if a list of names contains unnecessary spaces, the TRIM formula can be used to remove them. Similarly, the formula <strong>SUBSTITUTE<\/strong> can be used to delete all spaces directly.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-a89b3969\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/data-ai\/power-bi\">Learn to use Power Query formulas<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-date-transformation-formulas\">Date transformation formulas<\/h2>\n\n\n\n<p>To manipulate date and time data, we use date transformation formulas such as DATE, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, NOW and TODAY. These formulas are used to easily manipulate time data, or transform it into <strong>different formats as required.<\/strong> For example, if you have a list of dates in different formats, the DATEVALUE formula can be used to transform them into a standard format.<\/p>\n\n\n\n<p>Another use case is to extract the month from each of these dates. Simply use the <strong>MONTH formula.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-number-transformation-formulas\">Number transformation formulas<\/h2>\n\n\n\n<p>Numerical data manipulation is performed using Power Query number transformation formulas such as <strong>SUM, AVERAGE, MIN, MAX, COUNT and IF.<\/strong> The aim is to calculate basic statistics, or to perform mathematical operations on numerical data.<\/p>\n\n\n\n<p>Let&#8217;s take the example of a price list containing a column for each product. The SUM formula can be applied to calculate total sales for each product. And to extract price data above a certain value, nothing could be simpler: you can use the IF formula.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-search-and-filter-formulas\">Search and filter formulas<\/h2>\n\n\n\n<p>Within a list of data, it is sometimes necessary to extract specific information. For such tasks, you can use search and filter formulas such as VLOOKUP, HLOOKUP, INDEX, MATCH, FILTER and SORT. They enable you to quickly find specific information in a table or<a href=\"https:\/\/liora.io\/en\/datasets-top-5-places-to-find-quality-datasets\"> other data set.<\/a><\/p>\n\n\n\n<p>For example, on a list of product names, the VLOOKUP formula can be used to find the price of each one. SORT can also be used to sort the list alphabetically.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-merge-and-join-formulas\">Merge and join formulas<\/h2>\n\n\n\n<p>To combine multiple data from different sources, you can use merge and join formulas such as JOIN, MERGE, APPEND and UNION. This makes it easy to bring all data together in a single table. It&#8217;s the ideal way to get a complete overview.<\/p>\n\n\n\n<p>Let&#8217;s take the example of a list of sales from many different regions. To get a clearer picture, you can use the MERGE formula to combine all sales into a single table. With the APPEND formula, you can add a new column to this table.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-a89b3969\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/data-ai\/power-bi\">Mastering Power Query formulas<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-pivot-table-formulas\">Pivot table formulas<\/h2>\n\n\n\n<p>Pivot tables are commonly used for data analysis in Excel and Power BI. However, it is possible to create such tables from large quantities of data using formulas such as <a href=\"https:\/\/liora.io\/en\/excel-to-power-bi-how-to-transform-a-pivot-table-in-excel-into-a-dataset-that-can-be-used-by-power-bi\">PIVOT<\/a>, GROUP BY or AGGREGATE. This can be useful, for example, if you have a large sales list and want to create a table to view sales by region. In this case, simply use the PIVOT formula. Similarly, the GROUP BY formula can be used to group sales by month.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-use-power-query-formulas\">How to use Power Query formulas<\/h2>\n\n\n\n<p>Here&#8217;s how to use <strong>Power Query formulas<\/strong>. First, open the <a href=\"https:\/\/liora.io\/en\/power-query-vba-how-does-it-work\">Power Query editor in Excel<\/a> or Power BI. You can then load the data to be transformed using one of the loading options <strong>offered by Power Query<\/strong>, for example from a file or data source. To add a transformation step using a formula, click on the &#8220;Add Step&#8221; icon in the <strong>Power Query ribbon.<\/strong><\/p>\n\n\n\n<p>In the &#8220;Formula&#8221; window, you can enter your formula using the M language. It can be based on existing columns in the dataset, but it is also possible to create new columns. Once you&#8217;ve added the formula, click on &#8220;OK&#8221; to <strong>apply it to the dataset.<\/strong> You can then preview the results of the transformation in the <a href=\"https:\/\/liora.io\/en\/power-query-what-is-it-whats-it-for\">Power Query window.<\/a> All that&#8217;s left to do is save and load the data!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/liora.io\/app\/uploads\/2026\/02\/capture-ecran-excel-donnees-tableau-1024x572.jpg\" alt=\"\" title=\"\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion-m-formulas-extend-the-possibilities-of-power-query\">Conclusion: M formulas extend the possibilities of Power Query<\/h2>\n\n\n\n<p>Although it is possible to use the graphical interface of the <strong>Power Query editor, M-language formulas<\/strong> offer more possibilities. However, to use them, technical skills are required. To acquire them, Liora training courses are the right choice. Our dedicated <strong>Power BI course<\/strong> enables you to master the tool in just 5 days. You&#8217;ll learn about Power Query, the <a href=\"https:\/\/liora.io\/en\/dax-power-bi-all-about-the-query-programming-language\">DAX language<\/a> and DataViz, as well as more advanced concepts such as DataFlows and incremental updating. By the end of the course, you&#8217;ll be able to use Power BI to collect and analyze data and create interactive dashboards.<\/p>\n\n\n\n<p>As a Microsoft Learning Partner, our organization also prepares you for the <a href=\"https:\/\/liora.io\/en\/pl-300-how-to-obtain-power-bi-analyst-associate-certification\">PL-300 exam<\/a>, leading to Power BI Data Analyst Associate certification. All our training courses are carried out entirely online and remotely, and are eligible for funding options. Discover Liora!<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-675d14d2\" style=\"margin-top:var(--wp--preset--spacing--columns);margin-bottom:var(--wp--preset--spacing--columns)\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/data-ai\/power-bi\">Register for Power BI training<\/a><\/div>\n<\/div>\n\n\n\n<p>Now you know all about Power Query formulas. For more information on the same subject, take a look at our complete <a href=\"https:\/\/liora.io\/en\/power-query-what-is-it-whats-it-for\">guide to Power Query<\/a> and our <a href=\"https:\/\/liora.io\/en\/power-bi-microsofts-business-intelligence-solution\">dossier on Power BI.<\/a><\/p>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What are Power Query formulas and why use them?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Power Query formulas are expressions written in the M language that describe data transformation steps and are used to perform more advanced, precise manipulations on imported data beyond the graphical interface.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Which text transformation formulas are available in Power Query?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Text transformation formulas include functions like LEFT, RIGHT, UPPER, LOWER, PROPER, SUBSTITUTE, TRIM, CONCATENATE and LEN to clean and manipulate text data.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How do date transformation formulas work in Power Query?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Date transformation formulas such as DATE, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, NOW and TODAY allow users to manipulate and reformat date and time data within queries.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What number manipulation formulas exist in Power Query?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Number transformation formulas like SUM, AVERAGE, MIN, MAX, COUNT and IF are used to perform statistical calculations or mathematical operations on numerical data.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Which formulas help with searching and filtering data?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Search and filter formulas include VLOOKUP, HLOOKUP, INDEX, MATCH, FILTER and SORT, enabling extraction of specific information from lists or tables.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How do merge and join formulas function in Power Query?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Merge and join formulas like JOIN, MERGE, APPEND and UNION are used to combine data from different sources into a single dataset.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Can Power Query formulas create pivot table\u2013like outputs?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Yes \u2014 formulas such as PIVOT, GROUP BY and AGGREGATE allow the creation of pivot table\u2013style groupings and summaries directly within queries.\u00a0([turn0search0])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How do I apply a formula in Power Query?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"To use a formula in Power Query, open the Power Query editor, add a transformation step, enter the expression in the formula window using M language, and apply it to the dataset.\u00a0([turn0search0])\"\n      }\n    }\n  ]\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p><strong>Power Query formulas offer a wide range of possibilities for manipulating data in Excel and Power Query. Find out all you need to know about the different types and how to use them&#8230;<\/strong><\/p>\n","protected":false},"author":82,"featured_media":207894,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2433],"class_list":["post-176488","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/176488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=176488"}],"version-history":[{"count":4,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/176488\/revisions"}],"predecessor-version":[{"id":207896,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/176488\/revisions\/207896"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/207894"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=176488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=176488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}