Appendix B
Power Query M Functions

When using the Get & Transform tools, you might need to create a formula. The formula language used in the Power Query editor is the Power Query M language. This appendix is a categorized list of the Power Query M functions with the syntax and a short description.

The first table is an alphabetical list of Excel functions and the equivalent Power Query M function. If the Excel function is not in Table B.1, then there is no direct Power Query M equivalent.

Table B.1 Excel Functions and Power Query M Equivalents

Excel Function

Power Query

Category

ABS

Number.Abs

Number Operations (Table B.28)

ACOS

Number.Acos

Number Trigonometry (Table B.31)

ASIN

Number.Asin

Number Trigonometry (Table B.31)

ATAN

Number.Atan

Number Trigonometry (Table B.31)

AVERAGE

List.Average

List Averages (Table B.14)

BITAND

Number.BitwiseAnd

Number Bytes (Table B.24)

BITLSHIFT

Number.BitwiseShiftLeft

Number Bytes (Table B.24)

BITOR

Number.BitwiseOr

Number Bytes (Table B.24)

BITRSHIFT

Number.BitwiseShiftRight

Number Bytes (Table B.24)

BITXOR

Number.BitwiseXor

Number Bytes (Table B.24)

CEILING

Number.RoundAwayFromZero

Number Rounding (Table B.30)

CEILING.MATH

Number.RoundUp

Number Rounding (Table B.30)

CHAR

Character.FromNumber

Text Text Comparisons (Table B.47)

CLEAN

Text.Clean

Text Transformations (Table B.48)

CODE

Character.ToNumber

Text Text Comparisons (Table B.47)

COMBIN

Number.Combinations

Number Operations (Table B.28)

CONCAT

Text.Combine

Text Transformations (Table B.48)

COS

Number.Cos

Number Trigonometry (Table B.31)

COSH

Number.Cosh

Number Trigonometry (Table B.31)

COVARIANCE.P

List.Covariance

List Numerics (Table B.18)

DATEVALUE

Date.FromText

Date (Table B.6)

DAY

Date.Day

Date (Table B.6)

DEC2BIN

Text.ToBinary

Text Text Comparisons (Table B.47)

ENCODEURL

Uri.EscapeDataString

URI (Table B.51)

EOMONTH

Date.EndOfMonth

Date (Table B.6)

EXP

Number.E

Number Constants (Table B.25)

EXP

Number.Exp

Number Operations (Table B.28)

FACT

Number.Factorial

Number Operations (Table B.28)

FLOOR

Number.RoundTowardZero

Number Rounding (Table B.30)

FLOOR.MATH

Number.RoundDown

Number Rounding (Table B.30)

HOUR

Duration.Hours

Duration (Table B.9)

HOUR

Time.Hour

Time (Table B.49)

ISEVEN

Number.IsEven

Number Information (Table B.27)

ISODD

Number.IsOdd

Number Information (Table B.27)

ISOWEEKNUM

Date.WeekOfYear

Date (Table B.6)

LEFT

Text.Start

Text Extraction (Table B.43)

LEN

Text.Length

Text Information (Table B.44)

LN

Number.Ln

Number Operations (Table B.28)

LOG

Number.Log

Number Operations (Table B.28)

LOG10

Number.Log10

Number Operations (Table B.28)

LOWER

Text.Lower

Text Transformations (Table B.48)

MAX

List.Max

List Ordering (Table B.19)

MEDIAN

List.Median

List Ordering (Table B.19)

MID

Text.Middle

Text Extraction (Table B.43)

MIN

List.Min

List Ordering (Table B.19)

MINUTE

Duration.Minutes

Duration (Table B.9)

MINUTE

Time.Minute

Time (Table B.49)

MOD

Number.Mod

Number Operations (Table B.28)

MONTH

Date.Month

Date (Table B.6)

PERMUT

Number.Permutations

Number Operations (Table B.28)

PI

Number.PI

Number Constants (Table B.25)

POWER

Number.Power

Number Operations (Table B.28)

PRODUCT

List.Product

List Numerics (Table B.18)

PRODUCT

Value.Multiply

Value (Table B.52)

PROPER

Text.Proper

Text Transformations (Table B.48)

QUOTIENT

Value.Divide

Value (Table B.52)

RAND

Number.Random

Number Random (Table B.29)

RANDBETWEEN

Number.RandomBetween

Number Random (Table B.29)

REPLACE

Text.Replace

Text Modification (Table B.46)

REPT

Text.Repeat

Text Transformations (Table B.48)

RIGHT

Text.End

Text Extraction (Table B.43)

ROUND

Number.Round

Number Rounding (Table B.30)

SECOND

Duration.Seconds

Duration (Table B.9)

SECOND

Time.Second

Time (Table B.49)

SIGN

Number.Sign

Number Operations (Table B.28)

SIN

Number.Sin

Number Trigonometry (Table B.31)

SINH

Number.Sinh

Number Trigonometry (Table B.31)

SORT

List.Sort

List Ordering (Table B.19)

SQRT

Number.Sqrt

Number Operations (Table B.28)

STDEV

List.StandardDeviation

List Averages (Table B.14)

SUM

List.Sum

List Averages (Table B.14)

SUM

Value.Add

Value (Table B.52)

TAN

Number.Tan

Number Trigonometry (Table B.31)

TANH

Number.Tanh

Number Trigonometry (Table B.31)

TEXT

Date.ToText

Date (Table B.6)

TEXT

Number.FromText

Number Conversion and Formatting (Table B.26)

TEXT

Number.ToText

Number Conversion and Formatting (Table B.26)

TEXT

Text.From

Text Text Comparisons (Table B.47)

TEXT

Time.ToText

Time (Table B.49)

TEXTJOIN

Combiner.CombineTextByDelimiter

Combiner (Table B.4)

TRIM

Text.Trim

Text Transformations (Table B.48)

UNIQUE

List.Distinct

List Selection (Table B.20)

UPPER

Text.Upper

Text Transformations (Table B.48)

VALUE

Number.From

Number Conversion and Formatting (Table B.26)

VALUE

Value.FromText

Text Text Comparisons (Table B.47)

WEEKDAY

Date.DayOfWeek

Date (Table B.6)

YEAR

Date.Year

Date (Table B.6)

Troubleshooting

Power Query M functions are case sensitive.

In the Excel formula bar, you can enter =max( or =Max( or =MAX( or even =MAX (. In Power Query, you must enter the function with the exact case shown in the tables included in this appendix.

Excel Functions with Power Query M Equivalents

Table B.1 shows an alphabetical list of Excel functions with their Power Query M equivalents.

Accessing Data Functions in Power Query M

Table B.2 lists how to access data functions in Power Query M.

Table B.2 Accessing Data Functions in Power Query M

Access.Database(database,[options])

Returns a structural representation of an Microsoft Access database.

ActiveDirectory.Domains([forestRootDomainName])

Returns a table with Domain information available in the current domain or optional Active Directory forest.

AdobeAnalytics.Cubes([options])

Returns a table of multidimensional packages from Adobe Analyics.

AdoDotNet.DataSource(providerName, connectionString,[options])

Returns the schema collection for an ADO.NET data source.

AdoDotNet.Query(providerName, connectionString, query,[options])

Returns the result of running a native query on an ADO.NET data source.

AnalysisServices.Database(server, database, [options])

Returns a table of multidimensional cubes or tabular models from the Analysis Services database.

AnalysisServices.Databases(server,[options])

Returns the Analysis Services databases on a particular host.

AzureStorage.BlobContents(url,[options])

Returns the content of the specified blob from an Azure storage vault.

AzureStorage.Blobs(account,[options])

Returns a navigational table containing all containers found in the Azure Storage account. Each row has the container name and a link to the container blobs.

AzureStorage.Tables(accountName)

Returns a navigational table containing a row for each table found at the account URL from an Azure storage vault. Each row contains a link to the azure table.

Csv.Document(source, [columns], [delimiter], [extraValues], [encoding])

Returns the contents of a CSV document as a table using the specified encoding.

Cube.AddAndExpandDimensionColumn(cube, dimensionSelector, attributeNames, [newColumnNames])

Merges the specified dimension table, dimensionSelector, into the cube’s, cube, filter context and changes the dimensional granularity by expanding the specified set, attributeNames, of dimension attributes.

Cube.AddMeasureColumn(cube, column, measureSelector)

Adds a column with the name column to the cube that contains the results of the measure measureSelector applied in the row context of each row.

Cube.ApplyParameter(cube, parameter, [arguments])

Returns a cube after applying parameter with arguments to cube.

Cube.AttributeMemberId(attribute)

Returns the unique member identifier from a member property value.

Cube.AttributeMemberProperty(attribute, propertyName)

Returns the property propertyName of dimension attribute attribute.

Cube.CollapseAndRemoveColumns(cube, columnNames)

Changes the dimensional granularity of the filter context for the cube by collapsing the attributes mapped to the specified columns columnNames.

Cube.Dimensions(cube)

Returns a table containing the set of available dimensions within the cube.

Cube.DisplayFolders(cube)

Returns a nested tree of tables representing the display folder hierarchy of the objects (e.g., dimensions and measures) available for use in the cube.

Cube.MeasureProperties(cube)

Returns a table containing the set of available properties for measures that are expanded in the cube.

Cube.MeasureProperty(measure, propertyName)

Returns the property of a measure.

Cube.Measures(cube)

Returns a table containing the set of available measures within the cube.

Cube.Parameters(cube)

Returns a table containing the set of parameters that can be applied to the cube.

Cube.Properties(cube)

Returns a table containing the set of available properties for dimensions that are expanded in the cube.

Cube.PropertyKey(property)

Returns the key of property property.

Cube.ReplaceDimensions(cube, dimensions)

Replaces dimensions in a cube.

Cube.Transform(cube, transforms)

Applies the list cube functions, transforms, on the cube.

DB2.Database(server, database,[options])

Returns a table with data relating to the tables in the specified DB2 Database.

Excel.CurrentWorkbook()

Returns the tables in the current Excel workbook.

Excel.Workbook(workbook, [useHeaders], [delayTypes])

Returns a table representing sheets in the given Excel workbook.

Exchange.Contents()

Returns a table of contents from a Microsoft Exchange account.

Facebook.Graph(url)

Returns a table containing content from the Facebook graph .

File.Contents(path)

Returns the binary contents of the file located at a path.

Folder.Contents(path)

Returns a table containing the properties and contents of the files and folders found at a path.

Folder.Files(path)

Returns a table containing a row for each file found at a folder path, and subfolders. Each row contains properties of the folder or file and a link to its content.

GoogleAnalytics.Accounts()

Returns the Google Analytics accounts for the current credential.

Hdfs.Contents(url)

Returns a table containing a row for each folder and file found at the folder url, {0}, from a Hadoop file system. Each row contains properties of the folder or file and a link to its content.

Hdfs.Files(url)

Returns a table containing a row for each file found at the folder url, {0}, and subfolders from a Hadoop file system. Each row contains properties of the file and a link to its content.

HdInsight.Containers(accountName)

Returns a navigational table containing all containers found in the HDInsight account. Each row has the container name and table containing its files.

HdInsight.Contents(accountName)

Returns a navigational table containing all containers found in the HDInsight account. Each row has the container name and table containing its files.

HdInsight.Files(accountName, containerName)

Returns a table containing a row for each folder and file found at the container URL, and subfolders from an HDInsight account. Each row contains properties of the file/folder and a link to its content.

Informix.Database(server, database,[options])

Returns a table of SQL tables and views available in an Informix database on server server in the database instance named database.

Json.Document(jsonText, [encoding])

Returns the contents of a JSON document. The contents may be directly passed to the function as text, or it may be the binary value returned by a function like File.Contents.

Json.FromValue(value, [encoding])

Produces a JSON representation of a given value value with a text encoding specified by encoding.

MySQL.Database(server, database,[options])

Returns a table with data relating to the tables in the specified MySQL Database.

OData.Feed(serviceUri, [headers],[options])

Returns a table of OData feeds offered by an OData serviceUri.

Odbc.DataSource(connectionString,[options])

Returns a table of SQL tables and views from the ODBC data source specified by the connection string connectionString.

Odbc.InferOptions(connectionString)

Returns the result of trying to infer SQL capabilities for an ODBC driver.

Odbc.Query(connectionString, query,[options])

Connects to a generic provider with the given connection string and returns the result of evaluating the query.

OleDb.DataSource(connectionString,[options])

Returns a table of SQL tables and views from the OLE DB data source specified by the connection string.

OleDb.Query(connectionString, query,[options])

Returns the result of running a native query on an OLE DB data source.

Oracle.Database(server,[options])

Returns a table with data relating to the tables in the specified Oracle Database.

PostgreSQL.Database(server, database,[options])

Returns a table with data relating to the tables in the specified PostgreSQL Database.

RData.FromBinary(stream)

Returns a record of data frames from the RData file.

Salesforce.Data([loginURL],[options])

Connects to the Salesforce Objects API and returns the set of available objects (i.e., Accounts).

Salesforce.Reports([loginURL],[options])

Connects to the Salesforce Reports API and returns the set of available reports.

SapBusinessObjects.Universes(url)

Connects to the SAP BusinessObjects BI Universe at the specified URL and returns the set of available universes.

SapBusinessWarehouse.Cubes(server, systemNumberOrSystemId, sclientIds, [soptionsOrLogonGroups], [soptionss])

Returns the InfoCubes and queries in an SAP Business Warehouse system grouped by InfoArea.

SapHana.Database(server,[options])

Returns the packages in an SAP HANA database.

SharePoint.Contents(url, [options])

Returns a table containing a row for each folder and document found at the SharePoint site url. Each row contains properties of the folder or file and a link to its content.

SharePoint.Files(url,[options])

Returns a table containing a row for each document found at the SharePoint site url, and subfolders. Each row contains properties of the folder or file and a link to its content.

SharePoint.Tables(url,[options])

Returns a table containing the result of a SharePoint List as an OData feed.

Soda.Feed(url)

Returns the resulting table of a CSV file that can be accessed using the SODA 2.0 API. The URL must point to a valid SODA-compliant source that ends in a .csv extension.

Sql.Database(server, database,[options])

Returns a table containing SQL tables located on a SQL Server instance database.

Sql.Databases(server,[options])

Returns a table with references to databases located on a SQL Server instance. Returns a navigation table.

Sybase.Database(server, database,[options])

Returns a table with data relating to the tables in the specified Sybase Database.

Teradata.Database(server,[options])

Returns a table with data relating to the tables in the specified Teradata Database.

Web.Contents(url,[options])

Returns the contents downloaded from a web url as a binary value.

Web.Page(html)

Returns the contents of an HTML webpage as a table.

WebAction.Request(method, url,[options])

Creates an action that, when executed, will return the results of performing a method request against url using HTTP as a binary value.

Xml.Document(contents,[options], [encoding])

Returns the contents of an XML document as a hierarchical table (list of records).

Xml.Tables(contents,[options], [encoding])

Returns the contents of an XML document as a nested collection of flattened tables.

Binary Functions in Power Query M

Table B.3 List of Binary Functions in Power Query M

Binary.Buffer(binary)

Buffers the binary value in memory. The result of this call is a stable binary value, which means it will have a deterministic length and order of bytes.

Binary.Combine(binaries)

Combines a list of binaries into a single binary.

Binary.Compress(binary, compressionType)

Compresses a binary value using the given compression type.

Binary.Decompress(binary, compressionType)

Decompresses a binary value using the given compression type.

Binary.From(Value, [encoding])

Returns a binary value from the given value.

Binary.FromList(list)

Converts a list of numbers into a binary value.

Binary.FromText(text, encoding)

Decodes data from a text form into binary.

Binary.InferContentType(source)

Returns a record with field Content.Type that contains the inferred MIME-type.

Binary.Length(binary)

Returns the length of binary values.

Binary.ToList(binary)

Converts a binary value into a list of numbers.

Binary.ToText(binary, encoding)

Encodes binary data into a text form.

BinaryFormat.7BitEncodedSignedInteger(binary)

A binary format that reads a 64-bit signed integer that was encoded using a 7-bit variable-length encoding.

BinaryFormat.7BitEncodedUnsignedInteger(binary)

A binary format that reads a 64-bit unsigned integer that was encoded using a 7-bit variable-length encoding.

BinaryFormat.Binary([length])

Returns a binary format that reads a binary value.

BinaryFormat.Byte(binary)

A binary format that reads an 8-bit unsigned integer.

BinaryFormat.ByteOrder(binaryFormat, byteOrder)

Returns a binary format with the byte order specified by a function.

BinaryFormat.Choice(binaryFormat, choice, [type])

Returns a binary format that chooses the next binary format based on a value that has already been read.

BinaryFormat.Decimal(binary)

A binary format that reads a .NET 16-byte decimal value.

BinaryFormat.Double(binary)

A binary format that reads an 8-byte IEEE double-precision floating point value.

BinaryFormat.Group(binaryFormat, group, [extra], [lastKey])

Returns a binary format that reads a group of items. Each item value is preceded by a unique key value. The result is a list of item values.

BinaryFormat.Length(binaryFormat, length)

Returns a binary format that limits the amount of data that can be read. Both BinaryFormat.List and BinaryFormat.Binary can be used to read until end of the data. BinaryFormat.Length can be used to limit the number of bytes that are read.

BinaryFormat.List(binaryFormat, [countOrCondition])

Returns a binary format that reads a sequence of items and returns a list.

BinaryFormat.Null(binary)

A binary format that reads zero bytes and returns null.

BinaryFormat.Record(record)

Returns a binary format that reads a record. Each field in the record can have a different binary format.

BinaryFormat.SignedInteger16(binary)

A binary format that reads a 16-bit signed integer.

BinaryFormat.SignedInteger32(binary)

A binary format that reads a 32-bit signed integer.

BinaryFormat.SignedInteger64(binary)

A binary format that reads a 64-bit signed integer.

BinaryFormat.Single(binary)

A binary format that reads a 4-byte IEEE single-precision floating point value.

BinaryFormat.Text(length, [encoding])

Returns a binary format that reads a text value. The optional encoding value specifies the encoding of the text.

BinaryFormat.Transform(binaryFormat, transform)

Returns a binary format that will transform the values read by another binary format.

BinaryFormat.UnsignedInteger16(binary)

A binary format that reads a 16-bit unsigned integer.

BinaryFormat.UnsignedInteger32(binary)

A binary format that reads a 32-bit unsigned integer.

BinaryFormat.UnsignedInteger64(binary)

A binary format that reads a 64-bit unsigned integer.

Table.PartitionValues(table)

Returns information about how a table is partitioned.

Combiner Functions in Power Query M

Table B.4 List of Combiner Functions in Power Query M

Combiner.CombineTextByDelimiter(delimiters, [quoteStyle])

Returns a function that combines a list of text into a single text using the specified delimiter. Similar to Excel function TEXTJOIN.

Combiner.CombineTextByEachDelimiter(delimiters, [quoteStyle])

Returns a function that combines a list of text into a single text using each specified delimiter in sequence.

Combiner.CombineTextByLengths(lengths, [template])

Returns a function that merges a list of text into a single text.

Combiner.CombineTextByPositions(positions, [template])

Returns a function that merges a list of text into a single text.

Combiner.CombineTextByRanges(ranges, [template])

Returns a function that merges a list of text into a single text.

Comparer Functions in Power Query M

Table B.5 List of Comparer Functions in Power Query M

Comparer.Equals(comparer, x, y)

Returns a logical value based on the equality check over the two given values.

Comparer.FromCulture(culture, [ignoreCase])

Returns a comparer function given the culture and a logical value for case sensitivity for the comparison. The default value for ignoreCase is false. The value for culture are well-known text representations of locales used in the .NET framework.

Comparer.Ordinal(x, y)

Returns a comparer function which uses Ordinal rules to compare values.

Comparer.OrdinalIgnoreCase(x, y)

Returns a case-insensitive comparer function which uses Ordinal rules to compare the provided values x and y.

Date Functions in Power Query M

Table B.6 List of Date Functions in Power Query M

Date.AddDays(dateTime, days)

Returns a Date/DateTime/DateTimeZone value with the day portion incremented by the number of days provided. It also handles incrementing the month and year portions of the value as appropriate.

Date.AddMonths(dateTime, numberOfMonths)

Returns a DateTime value with the month portion incremented by n months.

Date.AddQuarters(dateTime, quarters)

Returns a Date/DateTime/DateTimeZone value incremented by the number of quarters provided. Each quarter is defined as a duration of three months. It also handles incrementing the year portion of the value as appropriate.

Date.AddWeeks(dateTime, weeks)

Returns a Date/DateTime/DateTimeZone value incremented by the number of weeks provided. Each week is defined as a duration of seven days. It also handles incrementing the month and year portions of the value as appropriate.

Date.AddYears(dateTime, years)

Returns a DateTime value with the year portion incremented by n years.

Date.Day(dateTime)

Returns the day for a DateTime value. Similar to Excel function DAY.

Date.DayOfWeek(dateTime, [firstDayOfWeek])

Returns a number between 0 and 6 representing the day of the week from a DateTime value. Similar to Excel function WEEKDAY.

Date.DayOfWeekName(date, [culture])

Returns the day of the week name.

Date.DayOfYear(dateTime)

Returns a number that represents the day of the year from a DateTime value.

Date.DaysInMonth(dateTime)

Returns the number of days in the month from a DateTime value.

Date.EndOfDay(dateTime)

Returns a DateTime value for the end of the day.

Date.EndOfMonth(dateTime)

Returns a DateTime value for the end of the month. Similar to Excel function EOMONTH.

Date.EndOfQuarter(dateTime)

Returns a Date/DateTime/DateTimeZone value representing the end of the quarter. The date and time portions are reset to their terminating values for the quarter. The timezone information is persisted.

Date.EndOfWeek(dateTime, [firstDayOfWeek])

Returns a DateTime value for the end of the week.

Date.EndOfYear(dateTime)

Returns a DateTime value for the end of the year.

Date.From(value, [culture])

Returns a Date value from a value.

Date.FromText(date, [culture])

Returns a Date value from a set of date formats and culture value. Similar to Excel function DATEVALUE.

Date.IsInCurrentDay(dateTime)

Indicates whether the given DateTime value dateTime occurs during the current day, as determined by the current date and time on the system.

Date.IsInCurrentMonth(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the current month, as determined by the current date and time on the system.

Date.IsInCurrentQuarter(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the current quarter, as determined by the current date and time on the system.

Date.IsInCurrentWeek(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the current week, as determined by the current date and time on the system.

Date.IsInCurrentYear(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the current year, as determined by the current date and time on the system.

Date.IsInNextDay(dateTime)

Indicates whether the given DateTime value dateTime occurs during the next day, as determined by the current date and time on the system.

Date.IsInNextMonth(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the next month, as determined by the current date and time on the system.

Date.IsInNextNDays(dateTime, days)

Indicates whether the given DateTime value dateTime occurs during the next number of days, as determined by the current date and time on the system.

Date.IsInNextNMonths(dateTime, months)

Indicates whether the given DateTime value dateTime occurs during the next number of months, as determined by the current date and time on the system.

Date.IsInNextNQuarters(dateTime, quarters)

Indicates whether the given DateTime value dateTime occurs during the next number of quarters, as determined by the current date and time on the system.

Date.IsInNextNWeeks(dateTime, weeks)

Indicates whether the given DateTime value dateTime occurs during the next number of weeks, as determined by the current date and time on the system.

Date.IsInNextNYears(dateTime, years)

Indicates whether the given DateTime value dateTime occurs during the next number of years, as determined by the current date and time on the system.

Date.IsInNextQuarter(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the next quarter, as determined by the current date and time on the system.

Date.IsInNextWeek(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the next week, as determined by the current date and time on the system.

Date.IsInNextYear(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the next year, as determined by the current date and time on the system.

Date.IsInPreviousDay(dateTime)

Indicates whether the given DateTime value dateTime occurs during the previous day, as determined by the current date and time on the system.

Date.IsInPreviousMonth(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the previous month, as determined by the current date and time on the system.

Date.IsInPreviousNDays(dateTime, days)

Indicates whether the given DateTime value dateTime occurs during the previous number of days, as determined by the current date and time on the system.

Date.IsInPreviousNMonths(dateTime, months)

Indicates whether the given DateTime value dateTime occurs during the previous number of months, as determined by the current date and time on the system.

Date.IsInPreviousNQuarters(dateTime, quarters)

Indicates whether the given DateTime value dateTime occurs during the previous number of quarters, as determined by the current date and time on the system.

Date.IsInPreviousNWeeks(dateTime, weeks)

Indicates whether the given DateTime value dateTime occurs during the previous number of weeks, as determined by the current date and time on the system.

Date.IsInPreviousNYears(dateTime, years)

Indicates whether the given DateTime value dateTime occurs during the previous number of years, as determined by the current date and time on the system.

Date.IsInPreviousQuarter(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the previous quarter, as determined by the current date and time on the system.

Date.IsInPreviousWeek(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the previous week, as determined by the current date and time on the system.

Date.IsInPreviousYear(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the previous year, as determined by the current date and time on the system.

Date.IsInYearToDate(dateTime)

Returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred in the period starting January 1st of the current year and ending on the current day, as determined by the current date and time on the system.

Date.IsLeapYear(dateTime)

Returns a logical value indicating whether the year portion of a DateTime value is a leap year.

Date.Month(dateTime)

Returns the month from a DateTime value. Similar to Excel function MONTH.

Date.MonthName(date, [culture])

Returns the name of the month component.

Date.QuarterOfYear(dateTime)

Returns a number between 1 and 4 for the quarter of the year from a DateTime value.

Date.StartOfDay(dateTime)

Returns a DateTime value for the start of the day.

Date.StartOfMonth(dateTime)

Returns a DateTime value representing the start of the month.

Date.StartOfQuarter(dateTime)

Returns a DateTime value representing the start of the quarter.

Date.StartOfWeek(dateTime, [firstDay])

Returns a DateTime value representing the start of the week.

Date.StartOfYear(dateTime)

Returns a DateTime value representing the start of the year.

Date.ToRecord(date)

Returns a record containing parts of a Date value.

Date.ToText(date, [format], [culture])

Returns a text value from a Date value. Similar to Excel function TEXT.

Date.WeekOfMonth(dateTime)

Returns a number for the count of week in the current month.

Date.WeekOfYear(dateTime, [firstDayOfWeek])

Returns a number for the count of week in the current year. Similar to Excel function ISOWEEKNUM.

Date.Year(dateTime)

Returns the year from a DateTime value. Similar to Excel function YEAR.

DateTime Functions in Power Query M

Table B.7 List of DateTime Functions in Power Query M

DateTime.AddZone(dateTime, timezoneHours, [timezoneMinutes])

Adds the timezonehours as an offset to the input DateTime value and returns a new DateTimeZone value.

DateTime.Date(dateTime)

Returns a date part from a DateTime value.

DateTime.FixedLocalNow()

Returns a DateTime value set to the current date and time on the system.

DateTime.From(value, [culture])

Returns a DateTime value from a value.

DateTime.FromFileTime(fileTime)

Returns a DateTime value from the supplied number.

DateTime.FromText(dateTime, [culture])

Returns a DateTime value from a set of date formats and culture value.

DateTime.IsInCurrentHour(dateTime)

Indicates whether the given DateTime value occurs during the current hour, as determined by the current date and time on the system.

DateTime.IsInCurrentMinute(dateTime)

Indicates whether the given DateTime value occurs during the current minute, as determined by the current date and time on the system.

DateTime.IsInCurrentSecond(dateTime)

Indicates whether the given DateTime value occurs during the current second, as determined by the current date and time on the system.

DateTime.IsInNextHour(dateTime)

Indicates whether the given DateTime value occurs during the next hour, as determined by the current date and time on the system.

DateTime.IsInNextMinute(dateTime)

Indicates whether the given DateTime value occurs during the next minute, as determined by the current date and time on the system.

DateTime.IsInNextNHours(dateTime, hours)

Indicates whether the given DateTime value occurs during the next number of hours, as determined by the current date and time on the system.

DateTime.IsInNextNMinutes(dateTime, minutes)

Indicates whether the given DateTime value occurs during the next number of minutes, as determined by the current date and time on the system.

DateTime.IsInNextNSeconds(dateTime, seconds)

Indicates whether the given DateTime value occurs during the next number of seconds, as determined by the current date and time on the system.

DateTime.IsInNextSecond(dateTime)

Indicates whether the given DateTime value occurs during the next second, as determined by the current date and time on the system.

DateTime.IsInPreviousHour(dateTime)

Indicates whether the given DateTime value occurs during the previous hour, as determined by the current date and time on the system.

DateTime.IsInPreviousMinute(dateTime)

Indicates whether the given DateTime value occurs during the previous minute, as determined by the current date and time on the system.

DateTime.IsInPreviousNHours(dateTime, hours)

Indicates whether the given DateTime value occurs during the previous number of hours, as determined by the current date and time on the system.

DateTime.IsInPreviousNMinutes(dateTime, minutes)

Indicates whether the given DateTime value occurs during the previous number of minutes, as determined by the current date and time on the system.

DateTime.IsInPreviousNSeconds(dateTime, seconds)

Indicates whether the given DateTime value occurs during the previous number of seconds, as determined by the current date and time on the system.

DateTime.IsInPreviousSecond(dateTime)

Indicates whether the given DateTime value occurs during the previous second, as determined by the current date and time on the system.

DateTime.LocalNow()

Returns a DateTime value set to the current date and time on the system.

DateTime.Time(dateTime)

Returns a time part from a DateTime value.

DateTime.ToRecord(dateTime)

Returns a record containing parts of a DateTime value.

DateTime.ToText(dateTime, [format], [culture])

Returns a text value from a DateTime value.

DateTimeZone Functions in Power Query M

Table B.8 List of DateTimeZone Functions in Power Query M

DateTimeZone.FixedLocalNow()

Returns a DateTimeZone value set to the current date, time, and timezone offset on the system.

DateTimeZone.FixedUtcNow()

Returns the current date and time in UTC (the GMT timezone).

DateTimeZone.From(value, [culture])

Returns a DateTimeZone value from a value.

DateTimeZone.FromFileTime(fileTime)

Returns a DateTimeZone from a number value.

DateTimeZone.FromText(dateTimeZone, [culture])

Returns a DateTimeZone value from a set of date formats and culture value.

DateTimeZone.LocalNow()

Returns a DateTime value set to the current system date and time.

DateTimeZone.RemoveZone(dateTimeZone)

Returns a DateTime value with the zone information removed from the input DateTimeZone value.

DateTimeZone.SwitchZone(dateTimeZone, timezoneHours, [timezoneMinutes])

Changes the timezone information for the input DateTimeZone.

DateTimeZone.ToLocal(dateTime)

Returns a DateTime value from the local time zone.

DateTimeZone.ToRecord(dateTimeZone)

Returns a record containing parts of a DateTime value.

DateTimeZone.ToText(dateTimeZone, [format], [culture])

Returns a text value from a DateTime value.

DateTimeZone.ToUtc(dateTime)

Returns a DateTime value to the Utc time zone.

DateTimeZone.UtcNow()

Returns a DateTime value set to the current system date and time in the Utc timezone.

DateTimeZone.ZoneHours(dateTime)

Returns a time zone hour value from a DateTime value.

DateTimeZone.ZoneMinutes(dateTimeZone)

Returns a time zone minute value from a DateTime value.

Duration Functions in Power Query M

Table B.9 List of Duration Functions in Power Query M

Duration.Days(duration)

Returns the day component of a Duration value.

Duration.From(value)

Returns a Duration value from a value.

Duration.FromText(duration)

Returns a Duration value from a text value.

Duration.Hours(duration)

Returns an hour component of a Duration value. Similar to Excel function HOUR.

Duration.Minutes(duration)

Returns a minute component of a Duration value. Similar to Excel function MINUTE.

Duration.Seconds(duration)

Returns a second component of a Duration value. Similar to Excel function SECOND.

Duration.ToRecord(duration)

Returns a record with parts of a Duration value.

Duration.TotalDays(duration)

Returns the total magnitude of days from a Duration value.

Duration.TotalHours(duration)

Returns the total magnitude of hours from a Duration value.

Duration.TotalMinutes(duration)

Returns the total magnitude of minutes from a Duration value.

Duration.TotalSeconds(duration)

Returns the total magnitude of seconds from a Duration value.

Duration.ToText(duration, [format])

Returns a text value from a Duration value.

Error Functions in Power Query M

Table B.10 List of Error Functions in Power Query M

Diagnostics.ActivityId()

Returns an opaque identifier for the currently-running evaluation.

Diagnostics.Trace(traceLevel, message, value, [delayed])

Writes a trace message, if tracing is enabled, and returns value.

Error.Record(reason, message, detail)

Returns a record containing fields “Reason”, “Message”, and “Detail” set to the provided values. The record can be used to raise or throw an error.

Expression Functions in Power Query M

Table B.11 List of Expression Functions in Power Query M

Expression.Constant(value)

Returns a constant text literal from a value.

Expression.Evaluate(expression, [environment])

Evaluates a text expression and returns the evaluated value.

Expression.Identifier(name)

Returns a text value that can be used as an identifier from a text value.

Function Functions in Power Query M

Table B.12 List of Function Functions in Power Query M

Function.From(functionType, function)

Takes a unary function and creates a new function with the type functionType that constructs a list out of its arguments and passes it to function.

Function.Invoke(function, args)

Invokes the given function using the specified and returns the result.

Function.InvokeAfter(function, delay)

Returns the result of invoking function after duration delay has passed.

Function.IsDataSource(function)

Returns whether or not function is considered a data source.

Lines Functions in Power Query M

Table B.13 List of Lines Functions in Power Query M

Lines.FromBinary(binary, [quoteStyle], [includeLineSeparators], [encoding])

Converts a binary value to a list of text values split at lines breaks.

Lines.FromText(text, [quoteStyle], [includeLineSeparators])

Converts a text value to a list of text values split at lines breaks.

Lines.ToBinary(lines, [lineSeparator], [encoding], [includeByteOrderMark])

Converts a list of text into a binary value using the specified encoding and lineSeparator. The specified lineSeparator is appended to each line. If not specified, then the carriage return and line feed characters are used.

Lines.ToText (lines, [lineSeparator])

Converts a list of text into a single text. The specified lineSeparator is appended to each line. If not specified, then the carriage return and line feed characters are used.

List Functions

The List functions are separated into these categories: List Generators, List Information, List Membership, List Numerics, List Ordering, List Selection, List Set Operations, and List Transformation.

List Averages Functions in Power Query M

Table B.14 List of List Averages Functions in Power Query M

List.Average(list)

Returns an average value from a list in the datatype of the values in the list. Similar to Excel function AVERAGE.

List.Mode(list, [equationCriteria])

Returns an item that appears most commonly in a list.

List.Modes(list, [equationCriteria])

Returns all items that appear with the same maximum frequency.

List.StandardDeviation(list)

Returns the standard deviation from a list of values. List.StandardDeviation performs a sample-based estimate. The result is a number for numbers, and a duration for DateTimes and Durations. Similar to Excel function STDEV.

List.Sum(list)

Returns the sum from a list. Similar to Excel function SUM.

List Generators Functions in Power Query M

Table B.15 List of List Generators Functions in Power Query M

List.Dates(start, count, step)

Returns a list of date values from size count, starting at start and adds an increment to every value.

List.DateTimes(start, count, step)

Returns a list of DateTime values from size count, starting at start and adds an increment to every value.

List.DateTimeZones(start, count, increment)

Returns a list of of DateTimeZone values from size count, starting at start and adds an increment to every value.

List.Durations(start, count, step)

Returns a list of durations values from size count, starting at start and adds an increment to every value.

List.Generate(initial, condition, next, [selector])

Generates a list from a value function, a condition function, a next function, and an optional transformation function on the values.

List.Numbers(start, count, [increment])

Returns a list of numbers from size count starting at initial and adds an increment. The increment defaults to 1.

List.Random(count, [seed])

Returns a list of count random numbers, with an optional seed parameter.

List.Times(start, count, step)

Returns a list of time values of size count, starting at start.

List Information Functions in Power Query M

Table B.16 List of List Information Functions in Power Query M

List.Count(list)

Returns the number of items in a list.

List.IsEmpty(list)

Returns whether a list is empty.

List.NonNullCount(list)

Returns the number of items in a list excluding null values.

List Membership Functions in Power Query M

Table B.17 List of List Membership Functions in Power Query M

List.AllTrue(list)

Returns true if all expressions in a list are true.

List.AnyTrue(list)

Returns true if any expression in a list in true.

List.Contains(list, value, [equationCriteria])

Returns true if a value is found in a list.

List.ContainsAll(list, values,[equationCriteria])

Returns true if all items in values are found in a list.

List.ContainsAny(list, values,[equationCriteria])

Returns true if any item in values is found in a list.

List.PositionOf(list, value, [occurrence],[equationCriteria])

Finds the first occurrence of a value in a list and returns its position.

List.PositionOfAny(list, values, [occurrence], [equationCriteria])

Finds the first occurrence of any value in values and returns its position.

List Numerics Functions in Power Query M

Table B.18 List of List Numerics Functions in Power Query M

List.Covariance(list1, list2)

Returns the covariance from two lists as a number. Similar to Excel function COVARIANCE.P.

List.Product(list)

Returns the product from a list of numbers. Similar to Excel function PRODUCT.

List Ordering Functions in Power Query M

Table B.19 List of List Ordering Functions in Power Query M

List.Max(list, [default], [comparisonCriteria], [includeNulls])

Returns the maximum item in a list, or the optional default value if the list is empty. Similar to Excel function MAX.

List.MaxN(list, countOrCondition, [comparisonCriteria], [includeNulls])

Returns the maximum values in the list. After the rows are sorted, optional parameters may be specified to further filter the result.

List.Median(list, [comparisonCriteria])

Returns the median item from a list. Similar to Excel function MEDIAN.

List.Min(list, [default], [comparisonCriteria], [includeNulls])

Returns the minimum item in a list, or the optional default value if the list is empty. Similar to Excel function MIN.

List.MinN(list, countOrCondition, [comparisonCriteria], [includeNulls])

Returns the minimum values in a list.

List.Sort(list, [comparisonCriteria])

Returns a sorted list using comparison criterion. Similar to Excel function SORT.

List Selection Functions in Power Query M

Table B.20 List of List Selection Functions in Power Query M

List.Alternate(list, count, [repeatInterval], [offset])

Returns a list with the items alternated from the original list based on a count, optional repeatInterval, and an optional offset.

List.Buffer(list)

Buffers the list in memory. The result of this call is a stable list, which means it will have a deterministic count, and order of items.

List.Distinct(list, [equationCriteria], criteria)

Filters a list down by removing duplicates. An optional equation criteria value can be specified to control equality comparison. The first value from each equality group is chosen. Similar to Excel function UNIQUE.

List.FindText(list, text)

Searches a list of values, including record fields, for a text value.

List.First(list, [defaultValue])

Returns the first value of the list or the specified default if empty. Returns the first item in the list, or the optional default value, if the list is empty. If the list is empty and a default value is not specified, the function returns.

List.FirstN(list, countOrCondition)

Returns the first set of items in the list by specifying how many items to return or a qualifying condition provided by countOrCondition.

List.InsertRange(list, offset, values)

Inserts items from values at the given index in the input list.

List.IsDistinct(list, [equationCriteria])

Returns whether a list is distinct.

List.Last(list, [defaultValue])

Returns the last set of items in the list by specifying how many items to return or a qualifying condition provided by countOrCondition.

List.LastN(list, [countOrCondition])

Returns the last set of items in a list by specifying how many items to return or a qualifying condition.

List.MatchesAll(list, condition)

Returns true if all items in a list meet a condition.

List.MatchesAny(list, condition)

Returns true if any item in a list meets a condition.

List.Positions(list)

Returns a list of positions for an input list.

List.Range(list, offset, [count])

Returns a count items starting at an offset.

List.Select(list, condition)

Selects the items that match a condition.

List.Single(list)

Returns the single item of the list or throws an Expression.Error if the list has more than one item.

List.SingleOrDefault(list, [default])

Returns a single item from a list.

List.Skip(list, [countOrCondition])

Skips the first item of the list. Given an empty list, it returns an empty list. This function takes an optional parameter countOrCondition to support skipping multiple values.

List Set Operations Functions in Power Query M

Table B.21 List of List Set Operations Functions in Power Query M

List.Difference(list1, list2,[equationCriteria])

Returns the items in list 1 that do not appear in list 2. Duplicate values are supported.

List.Intersect(list, [equationCriteria])

Returns a list from a list of lists and intersects common items in individual lists. Duplicate values are supported.

List.Union(list,[equationCriteria])

Returns a list from a list of lists and unions the items in the individual lists. The returned list contains all items in any input lists. Duplicate values are matched as part of the Union.

List.Zip(lists)

Returns a list of lists combining items at the same position.

List Transformation Functions in Power Query M

Table B.22 List of List Transformation Functions in Power Query M

List.Accumulate(list, seed, accumulator)

Accumulates a result from the list. Starting from the initial value seed, this function applies the accumulator function and returns the final result.

List.Combine(list)

Merges a list of lists into single list.

List.RemoveFirstN(table, [countOrCondition])

Returns a list with the specified number of elements removed from the list starting at the first element. The number of elements removed depends on the optional countOrCondition parameter.

List.RemoveItems(list1, list2)

Removes items from list1 that are present in list2 and returns a new list.

List.RemoveLastN(list, offset, [count])

Returns a list with the specified number of elements removed from the list starting at the last element. The number of elements removed depends on the optional countOrCondition parameter.

List.RemoveMatchingItems(list, values, [equationCriteria])

Removes all occurrences of the given values in the list.

List.RemoveNulls(list)

Removes null values from a list.

List.RemoveRange(list, offset, [count])

Returns a list that removes count items starting at offset. The default count is 1.

List.Repeat(list, count)

Returns a list that repeats the contents of an input list count times.

List.ReplaceMatchingItems(list, replacements,[equationCriteria])

Replaces occurrences of existing values in the list with new values using the provided equationCriteria. Old and new values are provided by the replacements parameters. An optional equation criteria value can be specified to control equality comparisons.

List.ReplaceRange(list, index, count, replaceWith)

Returns a list that replaces count values in a list with a replaceWith list starting at an index.

List.ReplaceValue(list, oldValue, newValue, replacer)

Searches a list of values for the value and replaces each occurrence with the replacement value.

List.Reverse(list)

Returns a list that reverses the items in a list.

List.Split(list, pageSize)

Splits the specified list into a list of lists using the specified page size.

List.Transform(list, transform)

Performs the function on each item in the list and returns the new list.

List.TransformMany(list, collectionTransform, resultTransform)

Returns a list whose elements are projected from the input list.

Logical Functions in Power Query M

Table B.23 List of Logical Functions in Power Query M

Logical.From(value)

Returns a logical value from a value.

Logical.FromText(text)

Returns a logical value of true or false from a text value.

Logical.ToText(logical)

Returns a text value from a logical value.

Number Functions

The Number category is split into Number Constants, Number Conversion and Formatting, Number Information, Number Operations, Number Random, Number Rounding, and Number Trigonometry.

Number Bytes Functions in Power Query M

Table B.24 List of Number Bytes Functions in Power Query M

Number.BitwiseAnd(number1, number2)

Returns the result of a bitwise AND operation on the provided operands. Similar to Excel function BITAND.

Number.BitwiseNot(x, y)

Returns the result of a bitwise NOT operation on the provided operands.

Number.BitwiseOr(x, y)

Returns the result of a bitwise OR operation on the provided operands. Similar to Excel function BITOR.

Number.BitwiseShiftLeft(x, y)

Returns the result of a bitwise shift left operation on the operands. Similar to Excel function BITLSHIFT.

Number.BitwiseShiftRight(x, y)

Returns the result of a bitwise shift right operation on the operands. Similar to Excel function BITRSHIFT.

Number.BitwiseXor(x, y)

Returns the result of a bitwise XOR operation on the provided operands. Similar to Excel function BITXOR.

Number Constants Functions in Power Query M

Table B.25 List of Number Constants Functions in Power Query M

Number.E

Returns 2.7182818284590451, the value of e up to 16 decimal digits. Similar to Excel function EXP.

Number.Epsilon

Returns the smallest possible number.

Number.NaN

Represents 0/0.

Number.NegativeInfinity

Represents -1/0.

Number.PI

Returns 3.1415926535897931, the value for Pi up to 16 decimal digits. Similar to Excel function PI.

Number.PositiveInfinity

Represents 1/0.

Number Conversion and Formatting Functions in Power Query M

Table B.26 List of Number Conversion and Formatting Functions in Power Query M

Byte.From(value, [culture], [roundingMode])

Returns a 8-bit integer number value from the given value.

Currency.From(value, [culture], [roundingMode])

Returns a currency value from the given value.

Decimal.From(value, [culture])

Returns a decimal number value from the given value.

Double.From(value, [culture])

Returns a double number value from the given value.

Int16.From(value, [culture], [roundingMode])

Returns a 16-bit integer number value from the given value.

Int32.From(value, [culture], [roundingMode])

Returns a 32-bit integer number value from the given value.

Int64.From(value, [culture], [roundingMode])

Returns a 64-bit integer number value from the given value.

Int8.From(value, [culture], [roundingMode])

Returns a signed 8-bit integer number value from the given value.

Number.From(value, [culture])

Returns a number value from a value. Similar to Excel function VALUE.

Number.FromText(text, [culture])

Returns a number value from a text value. Similar to Excel function TEXT.

Number.ToText(number, [format], [culture])

Returns a text value from a number value. Similar to Excel function TEXT.

Percentage.From(value, [culture])

Returns a percentage value from the given value.

Single.From(value, [culture])

Returns a single number value from the given value.

Number Information Functions in Power Query M

Table B.27 List of Number Information Functions in Power Query M

Number.IsEven(value)

Returns true if a value is an even number. Similar to Excel function ISEVEN.

Number.IsNaN(value)

Returns true if a value is Number.NaN.

Number.IsOdd(value)

Returns true if a value is an odd number. Similar to Excel function ISODD.

Number Operations Functions in Power Query M

Table B.28 List of Number Operations Functions in Power Query M

Number.Abs(number)

Returns the absolute value of a number. Similar to Excel function ABS.

Number.Combinations(setSize, combinationSize)

Returns the number of combinations of a given number of items for the optional combination size. Similar to Excel function COMBIN.

Number.Exp(number)

Returns a number representing e raised to a power. Similar to Excel function EXP.

Number.Factorial(number)

Returns the factorial of a number. Similar to Excel function FACT.

Number.IntegerDivide(number1, number2,[precision])

Divides two numbers and returns the whole part of the resulting number.

Number.Ln(number)

Returns the natural logarithm of a number. Similar to Excel function LN.

Number.Log(number, [base])

Returns the logarithm of a number to the base. Similar to Excel function LOG.

Number.Log10(number)

Returns the base-10 logarithm of a number. Similar to Excel function LOG10.

Number.Mod(number, divisor,[precision])

Divides two numbers and returns the remainder of the resulting number. Similar to Excel function MOD.

Number.Permutations(setSize, permutationSize)

Returns the number of total permutatons of a given number of items for the optional permutation size. Similar to Excel function PERMUT.

Number.Power(number, power)

Returns a number raised by a power. Similar to Excel function POWER.

Number.Sign(number)

Returns 1 for positive numbers, -1 for negative numbers, or 0 for zero. Similar to Excel function SIGN.

Number.Sqrt(number)

Returns the square root of a number. Similar to Excel function SQRT.

Number Random Functions in Power Query M

Table B.29 List of Number Random Functions in Power Query M

Number.Random()

Returns a random fractional number between 0 and 1. Similar to Excel function RAND.

Number.RandomBetween(bottom, top)

Returns a random number between the two given number values. Similar to Excel function RANDBETWEEN.

Number Rounding Functions in Power Query M

Table B.30 List of Number Rounding Functions in Power Query M

Number.Round(value, digits, roundingMode)

Rounds a number to a certain number of digits. Similar to Excel function ROUND.

Number.RoundAwayFromZero(value)

Returns Number.RoundUp(value) when value >= 0 and Number.RoundDown(value) when value < 0. Similar to Excel function CEILING.

Number.RoundDown(value)

Returns the largest integer less than or equal to a number value. Similar to Excel function FLOOR.MATH.

Number.RoundTowardZero(value)

Returns Number.RoundDown(x) when x >= 0 and Number.RoundUp(x) when x < 0. Similar to Excel function FLOOR.

Number.RoundUp(value)

Returns the larger integer greater than or equal to a number value. Similar to Excel function CEILING.MATH.

Number Trigonometry Functions in Power Query M

Table B.31 List of Number Trigonometry Functions in Power Query M

Number.Acos(angle)

Returns the arccosine of a number. Similar to Excel function ACOS.

Number.Asin(angle)

Returns the arcsine of a number. Similar to Excel function ASIN.

Number.Atan(angle)

Returns the arctangent of a number. Similar to Excel function ATAN.

Number.Atan2(y, x)

Returns the arctangent of the division of two numbers.

Number.Cos(angle)

Returns the cosine of a number. Similar to Excel function COS.

Number.Cosh(angle)

Returns the hyperbolic cosine of a number. Similar to Excel function COSH.

Number.Sin(angle)

Returns the sine of a number. Similar to Excel function SIN.

Number.Sinh(angle)

Returns the hyperbolic sine of a number. Similar to Excel function SINH.

Number.Tan(angle)

Returns the tangent of a number. Similar to Excel function TAN.

Number.Tanh(angle)

Returns the hyperbolic tangent of a number. Similar to Excel function TANH.

Record Functions

The Record functions are split into these categories: Record Selection, Record Serialization, Record Transformations, Table Construction, Table Conversions, Table Information, and Table Row Operations.

Record Information Functions in Power Query M

Table B.32 List of Record Information Functions in Power Query M

Record.FieldCount(record)

Returns the number of fields in a record.

Record.HasFields(record, fields)

Returns true if the field name or field names are present in a record.

Record Selection Functions in Power Query M

Table B.33 List of Record Selection Functions in Power Query M

Record.Field(record, field)

Returns the value of the given field. This function can be used to dynamically create field lookup syntax for a given record. In that way, it is a dynamic verison of the record[field] syntax.

Record.FieldNames(record)

Returns a list of field names in order of the record’s fields.

Record.FieldOrDefault(record, field, [defaultValue])

Returns the value of a field from a record, or the default value if the field does not exist.

Record.FieldValues(record)

Returns a list of field values in order of the record’s fields.

Record.SelectFields(record, fields, [missingField])

Returns a new record that contains the fields selected from the input record. The original order of the fields is maintained.

Record Serialization Functions in Power Query M

Table B.34 List of Record Serialization Functions in Power Query M

Record.FromList(list, fields)

Returns a record given a list of field values and a set of fields.

Record.FromTable(list)

Returns a record from a table of records containing field names and values.

Record.ToList(record)

Returns a list of values containing the field values of the input record.

Record.ToTable(record)

Returns a table of records containing field names and values from an input record.

Record Transformations Functions in Power Query M

Table B.35 List of Record Transformations Functions in Power Query M

Record.AddField(record, fieldName, value, [delayed])

Adds a field from a field name and value.

Record.Combine(list)

Combines the records in a list.

Record.RemoveFields(record, fields, [missingField])

Returns a new record that reorders the given fields with respect to each other. Any fields not specified remain in their original locations.

Record.RenameFields(record, renames, [missingField])

Returns a new record that renames the fields specified. The resultant fields will retain their original order. This function supports swapping and chaining field names. However, all target names plus remaining field names must constitute a unique set or an error will occur.

Record.ReorderFields(record, fieldOrder, [missingField])

Returns a new record that reorders fields relative to each other. Any fields not specified remain in their original locations. Requires two or more fields.

Record.TransformFields(record, transformOperations, [missingField])

Transforms fields by applying transformOperations. For more information about values supported by transformOperations, see Parameter Values.

Replacer Functions in Power Query M

Table B.36 List of Replacer Functions in Power Query M

Replacer.ReplaceText(text, old, new)

This function is provided to List.ReplaceValue or Table.ReplaceValue to replace text in list or table.

Replacer.ReplaceValue(value, old, new)

This function is passed List.ReplaceValue or Table.ReplaceValue to replace values in a list or table.

Splitter Functions in Power Query M

Table B.37 List of Splitter Functions in Power Query M

Splitter.SplitByNothing()

Returns a function that does no splitting, returning its argument as a single element list.

Splitter.SplitTextByAnyDelimiter(delimiters, [quoteStyle])

Returns a function that splits text by any supported delimiter.

Splitter.SplitTextByDelimiter(delimiter, [quoteStyle])

Returns a function that will split text according to a delimiter.

Splitter.SplitTextByEachDelimiter(delimiters, [quoteStyle])

Returns a function that splits text by each delimiter in turn.

Splitter.SplitTextByLengths(lengths)

Returns a function that splits text according to the specified lengths.

Splitter.SplitTextByPositions(positions)

Returns a function that splits text according to the specified positions.

Splitter.SplitTextByRanges(ranges)

Returns a function that splits text according to the specified ranges.

Splitter.SplitTextByRepeatedLengths(length, [startAtEnd])

Returns a function that splits text into a list of text after the specified length repeatedly.

Splitter.SplitTextByWhitespace([quoteStyle])

Returns a function that splits text according to whitespace.

Table Functions

This category is split into Table Construction, Table Conversions, and Table Information.

Table Column Operations Functions in Power Query M

Table B.38 List of Table Column Operations Functions in Power Query M

Table.Column(table, column)

Returns the values from a column in a table.

Table.ColumnNames(table)

Returns the names of columns from a table.

Table.ColumnsOfType(table, listOfTypes)

Returns a list with the names of the columns that match the specified types.

Table.DemoteHeaders(table)

Demotes the header row down into the first row of a table.

Table.DuplicateColumn(table, columnName,newColumnName, [columnType])

Duplicates a column with the specified name. Values and type are copied from the source column.

Table.HasColumns(table, columns)

Returns true if a table has the specified column or columns.

Table.Pivot(table, pivotValues, attributeColumn, valueColumn, [aggregationFunction])

Given a table and attribute column containing pivotValues, creates new columns for each of the pivot values and assigns them values from the valueColumn. An optional aggregationFunction can be provided to handle multiple occurrence of the same key value in the attribute column.

Table.PrefixColumns(table, prefix)

Returns a table where the columns have all been prefixed with a text value.

Table.PromoteHeaders(table,[options])

Promotes the first row of the table into its header or column names.

Table.RemoveColumns(table, columns, [missingField])

Returns a table without a specific column or columns.

Table.RenameColumns(table, renames, [missingField])

Returns a table with the columns renamed as specified.

Table.ReorderColumns(table, columnOrder, [missingField])

Returns a table with specific columns in an order relative to one another.

Table.SelectColumns(table, columns, [missingField])

Returns a table that contains only specific columns.

Table.TransformColumnNames(table, nameGenerator,[options])

Transforms column names by using the given function.

Table.Unpivot(table, pivotColumns, attributeColumn, valueColumn)

Given a list of table columns, transforms those columns into attribute-value pairs.

Table.UnpivotOtherColumns(table, pivotColumns, attributeColumn, valueColumn)

Translates all columns other than a specified set into attribute-value pairs, combined with the rest of the values in each row.

Table Construction Functions in Power Query M

Table B.39 List of Table Construction Functions in Power Query M

ItemExpression.From(function)

Returns the AST for the body of a function.

RowExpression.Column(columnName)

Returns an AST that represents access to a column within a row expression.

RowExpression.From(function)

Returns the AST for the body of a function.

RowExpression.Row(function)

An AST node representing the row in a row expression.

Table.FromColumns(lists, [columns])

Returns a table from a list containing nested lists with the column names and values.

Table.FromList(list, [splitter], [columns], [default], [extraValues])

Converts a list into a table by applying the specified splitting function to each item in the list.

Table.FromRecords(records, [columns], [missingField])

Returns a table from a list of records.

Table.FromRows(rows, [columns])

Creates a table from the list where each element of the list is a list that contains the column values for a single row.

Table.FromValue(value)

Returns a table with a column containing the provided value or list of values.

Table.Split(table, pageSize)

Splits the specified table into a list of tables using the specified page size.

Table.View(table, handlers)

Creates or extends a table with user-defined handlers for query and action operations.

Table.ViewFunction(function)

Creates a function that can be intercepted by a handler defined on a view (via Table.View).

Table Conversions Functions in Power Query M

Table B.40 List of Table Conversions Functions in Power Query M

Table.ToColumns(table)

Returns a list of nested lists each representing a column of values in the input table.

Table.ToList(table, [combiner])

Returns a table into a list by applying the specified combining function to each row of values in a table.

Table.ToRecords(table)

Returns a list of records from an input table.

Table.ToRows(table)

Returns a nested list of row values from an input table.

Table Information Functions in Power Query M

Table B.41 List of Table Information Functions in Power Query M

Table.ColumnCount(table)

Returns the number of columns in a table.

Table.IsEmpty(table)

Returns true if the table does not contain any rows.

Table.Profile(table)

Returns a profile of the columns of a table.

Table.RowCount(table)

Returns the number of rows in a table.

Table.Schema(table)

Returns a table containing a description of the columns (i.e., the schema) of the specified table.

Tables.GetRelationships(tables, [dataColumn])

Returns the relationships among a set of tables.

Table Row Operations Functions in Power Query M

Table B.42 List of Table Row Operations Functions in Power Query M

Table.AlternateRows(table, offset, skip, take)

Returns a table containing an alternating pattern of the rows from a table.

Table.Combine(tables, [columns])

Returns a table that is the result of merging a list of tables. The tables must all have the same row type structure.

Table.FindText(table,text)

Returns a table containing only the rows that have the specified text within one of their cells or any part thereof.

Table.First(table,[default])

Returns the first row from a table.

Table.FirstN( table, [countOrCondition])

Returns the first row(s) of a table, depending on the countOrCondition parameter.

Table.FirstValue(table, [default])

Returns the first column of the first row of the table or a specified default value.

Table.FromPartitions(partitionColumn, partitions, [partitionColumnType])

Returns a table that is the result of combining a set of partitioned tables into new columns. The type of the column can optionally be specified; the default is any.

Table.InsertRows(table, offset, rows)

Returns a table with the list of rows inserted into the table at an index. Each row to insert must match the row type of the table.

Table.Last(table, [default])

Returns the last row of a table.

Table.LastN(table, countOrCondition)

Returns the last row(s) from a table, depending on the countOrCondition parameter.

Table.MatchesAllRows(table, condition)

Returns true if all of the rows in a table meet a condition.

Table.MatchesAnyRows(table, condition)

Returns true if any of the rows in a table meet a condition.

Table.Partition(Table.FromRecords({[A=1], [A=2], [A=3], [A=4], [A=5], [A=6]}),”A”, 2, each _)

Partitions the table into a list of groups number of tables, based on the value of the column of each row and a hash function. The hash function is applied to the value of the column of a row to obtain a hash value for the row. The hash value modulo groups determines in which of the returned tables the row will be placed.

Table.Range(table, offset, [count])

Returns the specified number of rows from a table starting at an offset.

Table.RemoveFirstN(table, [countOrCondition])

Returns a table with the specified number of rows removed from the table starting at the first row. The number of rows removed depends on the optional countOrCondition parameter.

Table.RemoveLastN(table, [countOrCondition])

Returns a table with the specified number of rows removed from the table starting at the last row. The number of rows removed depends on the optional countOrCondition parameter.

Table.RemoveRows(table, offset, [count])

Returns a table with the specified number of rows removed from the table starting at an offset.

Table.RemoveRowsWithErrors(table, [columns])

Returns a table with all rows removed from the table that contain an error in at least one of the cells in a row.

Table.Repeat(table, count)

Returns a table containing the rows of the table repeated the count number of times.

Table.ReplaceRows(table, offset, count, rows)

Returns a table where the rows beginning at an offset and continuing for count are replaced with the provided rows.

Table.ReverseRows(table)

Returns a table with the rows in reverse order.

Table.SelectRows(table, condition)

Returns a table containing only the rows that match a condition.

Table.SelectRowsWithErrors(table, [columns])

Returns a table with only the rows from table that contain an error in at least one of the cells in a row.

Table.SingleRow(table)

Returns a single row from a table.

Table.Skip(table, [countOrCondition])

Returns a table that does not contain the first row or rows of the table.

Text Functions

The text functions are split into Text Information, Text Membership, Text Modification, Text Comparisons, and Text Transformations.

Text Extraction Functions in Power Query M

Table B.43 List of Text Extraction Functions in Power Query M

Text.At(value, index)

Returns a character starting at a zero-based offset.

Text.End(string, numChars)

Returns the number of characters from the end of a text value. Similar to Excel function RIGHT.

Text.Middle(text, start, [count])

Returns the substring up to a specific length. Similar to Excel function MID.

Text.Range(text, offset, [count])

Returns a number of characters from a text value starting at a zero-based offset and for count number of characters.

Text.Start(string, count)

Returns the count of characters from the start of a text value. Similar to Excel function LEFT.

Text Information Functions in Power Query M

Table B.44 List of Text Information Functions in Power Query M

Text.Length(text)

Returns the number of characters in a text value. Similar to Excel function LEN.

Text Membership Functions in Power Query M

Table B.45 List of Text Membership Functions in Power Query M

Text.Contains(string, substring, [comparer])

Returns true if a text value substring was found within a text value string; otherwise, false.

Text.EndsWith(string, substring, [comparer])

Returns a logical value indicating whether a text value substring was found at the end of a string.

Text.PositionOf(text, substring, [occurrence], [comparer])

Returns the first occurrence of substring in a string and returns its position starting at startOffset.

Text.PositionOfAny(string, list, [occurrence])

Returns the first occurrence of a text value in list and returns its position starting at startOffset.

Text.StartsWith(string, substring, [comparer])

Returns a logical value indicating whether a text value substring was found at the beginning of a string.

Text Modification Functions in Power Query M

Table B.46 List of Text Modification Functions in Power Query M

Text.Insert(text, offset, newText)

Returns a text value with newValue inserted into a text value starting at a zero-based offset.

Text.Remove(text, removeChars)

Removes all occurrences of a character or list of characters from a text value. The removeChars parameter can be a character value or a list of character values.

Text.RemoveRange(text, offset, count)

Removes count characters at a zero-based offset from a text value.

Text.Replace(text,old,new)

Replaces all occurrences of a substring with a new text value. Similar to Excel function REPLACE.

Text.ReplaceRange(text, offset, length, newText)

Replaces length characters in a text value starting at a zero-based offset with the new text value.

Text.Select(text, selectChars)

Selects all occurrences of the given character or list of characters from the input text value.

Text Comparisons Functions in Power Query M

Table B.47 List of Text Comparisons Functions in Power Query M

Character.FromNumber(number)

Returns a number to its character value. Similar to Excel function CHAR.

Character.ToNumber(character)

Returns a character to its number value. Similar to Excel function CODE.

Guid.From(value)

Returns a Guid.Type value from the given value.

Json.FromValue(value, [encoding])

Produces a JSON representation of a given value.

Text.From(value, [culture])

Returns the text representation of a number, date, time, datetime, DateTimeZone , logical, duration, or binary value. If a value is null, Text.From returns null. The optional culture parameter is used to format the text value according to the given culture. Similar to Excel function TEXT.

Text.FromBinary(binary, [encoding])

Decodes data from a binary value into a text value using an encoding.

Text.NewGuid()

Returns a Guid value as a text value.

Text.ToBinary(text, [encoding], [includeByteOrderMark])

Encodes a text value into binary value using an encoding. Similar to Excel function DEC2BIN.

Text.ToList(text)

Returns a list of characters from a text value.

Value.FromText(value, [culture])

Decodes a value from a textual representation, value, and interprets it as a value with an appropriate type. Value.FromText takes a text value and returns a number, a logical value, a null value, a DateTime value, a Duration value, or a text value. The empty text value is interpreted as a null value. Similar to Excel function VALUE.

Text Transformations Functions in Power Query M

Table B.48 List of Text Transformations Functions in Power Query M

Text.AfterDelimiter(text, delimiter, [index])

Returns the portion of text after the specified delimiter.

Text.BeforeDelimiter(text, delimiter, [index])

Returns the portion of text before the specified delimiter.

Text.BetweenDelimiters(text, startDelimiter, endDelimiter, [startIndex], [endIndex])

Returns the portion of text between the specified startDelimiter and endDelimiter.

Text.Clean(string)

Returns the original text value with non-printable characters removed. Similar to Excel function CLEAN.

Text.Combine(text, separator)

Returns a text value that is the result of joining all text values with each value separated by a separator. Similar to Excel function CONCAT.

Text.Lower(string)

Returns the lowercase of a text value. Similar to Excel function LOWER.

Text.PadEnd(text, length, pad)

Returns a text value padded at the end with pad to make it at least length characters.

Text.PadStart(text, length, [pad])

Returns a text value padded at the beginning with pad to make it at least length characters. If pad is not specified, whitespace is used as pad.

Text.Proper(string)

Returns a text value with first letters of all words converted to uppercase. Similar to Excel function PROPER.

Text.Repeat(string, repeatCount)

Returns a text value composed of the input text value repeated a number of times. Similar to Excel function REPT.

Text.Reverse(text)

Reverses the provided text.

Text.Split(string, separator)

Returns a list containing parts of a text value that are delimited by a separator text value.

Text.SplitAny(string, separator)

Returns a list containing parts of a text value that are delimited by any separator text values.

Text.Trim(text, [trimChars])

Removes any occurrences of characters in trimChars from text. Similar to Excel function TRIM.

Text.TrimEnd(text, [trimChars])

Removes any occurrences of the characters specified in trimChars from the end of the original text value.

Text.TrimStart(text, [trimChars])

Removes any occurrences of the characters in trimChars from the start of the original text value.

Text.Upper(string)

Returns the uppercase of a text value. Similar to Excel function UPPER.

Time Functions in Power Query M

Table B.49 List of Time Functions in Power Query M

Time.EndOfHour(dateTime)

Returns a DateTime value from the end of the hour.

Time.From(value, [culture])

Returns a time value from a value.

Time.FromText(time, [culture])

Returns a time value from a set of date formats.

Time.Hour(dateTime)

Returns an hour value from a DateTime value. Similar to Excel function HOUR.

Time.Minute(dateTime)

Returns a minute value from a DateTime value. Similar to Excel function MINUTE.

Time.Second(#datetime(2011, 12, 31, 9, 15, 36.5))

Returns a second value from a DateTime value Similar to Excel function SECOND.

Time.StartOfHour(datetime)

Returns the first value of the hour from a time value.

Time.ToRecord(time)

Returns a record containing parts of a date value.

Time.ToText(time, [format], [culture])

Returns a text value from a time value. Similar to Excel function TEXT.

Type Functions in Power Query M

Table B.50 List of Type Functions in Power Query M

Type.AddTableKey(table, columns, isPrimary)

Add a key to a table type.

Type.ClosedRecord(#”type”)

The given type must be a record type and returns a closed version of the given record type (or the same type, if it is already closed).

Type.Facets(type)

Returns the facets of a type.

Type.ForFunction(signature, parameter, min)

Creates a return type for a function and specifies the minimum number of arguments required to invoke the function.

Type.ForRecord(fields, open)

Returns a record type from a fields record.

Type.FunctionParameters(functionType)

Returns a record with field values set to the name of the parameters of a function type, and their values set to their corresponding types.

Type.FunctionRequiredParameters(#”type”)

Returns a number indicating the minimum number of parameters required to invoke the type of function.

Type.FunctionReturn(type)

Returns a type returned by a function type.

Type.Is(type1, type2)

Returns True or False if the column is of type1 or type2.

Type.IsNullable(#”type”)

Returns true if a type is a nullable type; otherwise, false.

Type.IsOpenRecord(#”type”)

Returns whether a record type is open.

Type.ListItem(#”type”)

Returns an item type from a list type.

Type.NonNullable(#”type”)

Returns the non nullable type from a type.

Type.OpenRecord(#”type”)

Returns an opened version of a record type, or the same type, if it is already open.

Type.RecordFields(#”type”)

Returns a record describing the fields of a record type with each field of the returned record type having a corresponding name and a value that is a record of the form [ Type = type, Optional = logical ].

Type.ReplaceFacets(type, facets)

Replaces the facets of a type.

Type.ReplaceTableKeys(tableType, keys)

Replaces the keys in a table type.

Type.TableColumn(tableType, column)

Returns the type of a column in a table.

Type.TableKeys(tableType)

Returns keys from a table type.

Type.TableRow(table)

Returns a row type from a table type.

Type.TableSchema(tableType)

Returns a table containing a description of the columns (i.e., the schema) of the specified table type.

Type.Union(types)

Returns the union of a list of types.

URI Functions in Power Query M

Table B.51 List of URI Functions in Power Query M

Uri.BuildQueryString(query)

Assemble a record into a URI query string.

Uri.Combine(baseUri, relativeUri)

Returns a Uri based on the combination of the base and relative parts.

Uri.EscapeDataString(data)

Encodes special characters in accordance with RFC 3986. Similar to Excel function ENCODEURL.

Uri.Parts(absoluteUri)

Returns a record value with the fields set to the parts of a Uri text value.

Value Functions in Power Query M

Table B.52 List of Value Functions in Power Query M

DirectQueryCapabilities.From(value)

DirectQueryCapabilities.From

Embedded.Value(value, path)

Accesses a value by name in an embedded mashup.

SqlExpression.SchemaFrom(schema)

SqlExpression.SchemaFrom

SqlExpression.ToExpression(sql, environment)

SqlExpression.ToExpression

Value.Add(value1, value2,[precision])

Returns the sum of the two values. Similar to Excel function SUM.

Value.As(value, type)

Value.As is the function corresponding to the as operator in the formula language. The expression value as type asserts that the value of a value argument is compatible with type as per the is operator. If it is not compatible, an error is raised.

Value.Compare(value1, value2,[precision])

Returns 1, 0, or -1 based on value1 being greater than, equal to, or less than the value2. An optional comparer function can be provided.

Value.Divide(value1, value2,[precision])

Returns the result of dividing the first value by the second. Similar to Excel function QUOTIENT.

Value.Equals(left, right, equater)

Returns whether two values are equal.

Value.Firewall(key)

Value.Firewall

Value.Is(value, type)

Value.Is is the function corresponding to the is operator in the formula language. The expression value is type returns true if the ascribed type of vlaue is compatible with type, and returns false if the ascribed type of value is incompatible with type.

Value.Metadata(value)

Returns a record containing the input’s metadata.

Value.Multiply(value1, value2,[precision])

Returns the product of the two values. Similar to Excel function PRODUCT.

Value.NativeQuery(target, query, [paremeters],[options])

Evaluates a query against a target.

Value.NullableEquals(value1, value2)

Returns a logical value or null based on two values.

Value.RemoveMetadata(value)

Removes the metadata on the value and returns the original value.

Value.ReplaceMetadata(value, newMeta)

Replaces the metadata on a value with the new metadata record provided and returns the original value with the new metadata attached.

Value.Replacetype(value, replacedType)

A value may be ascribed a type using Value.ReplaceType. Value.ReplaceType either returns a new value with the type ascribed or raises an error if the new type is incompatible with the value’s native primitive type.

Value.Subtract(value1, value2,[precision])

Returns the difference of the two values.

Value.Type(value)

Returns the type of the given value.

Variable.Value(identifier)

Returns the value of the variable stored in identifier.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.245.219