Table.SingleRow Function in Power Query
The Table.SingleRow function returns a single row from a table. Returns the single row in the one row table. If the table does not contain exactly one row, an error is raised.
Syntax
Table.SingleRow(table as table) as record
Example: The Table.FromRecords functions returns the table.
Power Query M
let Source = Table.FromRecords({[CustomerID = 1, Name = "Ashish", Country = "India"]}) in Source
The output of the above code is shown below:
The Table.SingleRow function returns the single row from the table as record.
Power Query M
let Source = Table.SingleRow(Table.FromRecords({[CustomerID = 1, Name = "Ashish", Country = "India"]})) in Source
The output of the above code is shown below:
[CustomerID = 1, Name = "Ashish", Country = "India"]