Table.SingleRow is a Power Query M function that returns the single row in a one-row table. The function throws an exception if the table has more than one row.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Table.SingleRow( table as table ) as record
Description
Returns the single row in the one row table
. If the table
has more than one row, an exception is thrown.
Examples
Return the single row in the table.
// Output: [CustomerID = 1, Name = "Bob", Phone = "123-4567"]
Table.SingleRow( Table.FromRecords( {[CustomerID = 1, Name = "Bob", Phone = "123-4567"]} ) )
Related functions
Other functions related to Table.SingleRow are:
- Table.AggregateTableColumn
- Table.First
- Table.FirstN
- Table.FirstValue
- Table.Last
- Table.LastN
- Table.Max
- Table.MaxN
- Table.Min
- Table.MinN
