getResourceAttributes Function
This function will query all your resources and provide a list of attributes with their values. The table will provide you with a row per resource and attribute, but this can later be pivoted.
The values will be determined by the following parameters:
- Resource Name (Required)
Note:
Resource Name parameter is required, however can provide a blank value ("") which will provide all resources.
For more detail on the parameters see the full list of descriptions here.
function (resourceName as text)
Invoking the Functions
Here is an example of invoking them using Power Query or through the visual editor.
getResourceAttributes("000MS_C_inst")
Note:
You can fill out the function parameters and click _Invoke _to create the table automatically. See example below.
getResourceAttributes Result:
The following field columns will be outputted in a table.
#table({
"resourceId",
"resourceName",
"tree",
"type",
"attributeShortName",
"attributeName",
"attributeValue",
"row"
}, {})
Tip:
You can pivot the attributeName or attributeShortName to display the data with one resource per row and each cell with the attributeValue; see example below.
let
Source = getResourceAttributes(""),
#"Removed Columns" = Table.RemoveColumns(Source,{"attributeName", "row"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[attributeShortName]), "attributeShortName", "attributeValue", List.Max)
in
#"Pivoted Column"
You can copy the above directly in your power query advanced editor.
Updated 11 months ago