Record.SelectFields

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

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

Record.SelectFields(record as record,  fields as any,  optional missingField as nullable number) as record  

ArgumentDescription
recordThe record to check.
fieldsA single field name or list of field names.
optional missingFieldA MissingField enum value to handle missing fields. The default value is MissingField.Error.

MissingField enum

  • MissingField.Error = 0;

  • MissingField.Ignore = 1;

  • MissingField.UseNull = 2;

  • The original order of the fields is maintained.
Record.SelectFields([A=1, B=2], "B") equals [B=2]  

Record.SelectFields([A=1, B=2, C=3], {"C", "B"}) equals [B=2, C=3]  

Show: