0% found this document useful (0 votes)
9 views4 pages

M Query Functions and Use Cases

The document provides a list of M query functions and their syntax for data manipulation in Power BI. It includes functions for filtering, adding, removing, renaming, sorting, and grouping data, as well as text and number operations. Additionally, it outlines use cases for each function, demonstrating their practical applications.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

M Query Functions and Use Cases

The document provides a list of M query functions and their syntax for data manipulation in Power BI. It includes functions for filtering, adding, removing, renaming, sorting, and grouping data, as well as text and number operations. Additionally, it outlines use cases for each function, demonstrating their practical applications.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd

Function Syntax

let ... in block let Source = ... in Source

[Link](table, each
[Link]
[Column] > value)

[Link](table, "NewCol",
[Link]
each [Column] * 0.1)

[Link](table, {"Col1",
[Link]
"Col2"})

[Link](table, {{"Old",
[Link]
"New"}})

[Link](table, {{"Column",
[Link]
[Link]}})

[Link](table, {"GroupByCol"},
[Link] {{"NewCol", each [Link]([Col]),
type number}})

[Link] [Link]("abc")
[Link] [Link]("ABC")

[Link] [Link]("Power")

[Link]("Power BI", "BI",


[Link]
"Query")

[Link] [Link](3.1415, 2)

[Link] [Link](-5)

[Link] [Link](2, 3)

[Link] [Link]([Date])

[Link] [Link]([Date])

[Link] [Link]([Date])

[Link] [Link]([Record])

[Link] [Link]({1, 2, 3})

[Link] [Link]({1, 2, 3})


Use Case

Structure of M queries

Filter rows based on a condition

Add a calculated/custom column

Remove unwanted columns

Rename columns

Sort rows

Group and aggregate data

Convert text to uppercase


Convert text to lowercase

Get length of text (returns 5)

Replace part of a string

Round to 2 decimal places

Absolute value

Power function: 2³ = 8

Extract year from a date

Extract month from a date

Extract day from a date

Get all values from a record

Sum values in a list

Count items in a list

You might also like