You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+138-4
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Data Package Connector (datapackage-connector)
2
2
3
-
A Power BI [Custom Connector](https://docs.microsoft.com/en-us/power-bi/desktop-connector-extensibility#custom-connectors) based on the [Data Package M (datapackage-m)](https://github.com/nimblelearn/datapackage-m) functions. Data Package Connector enables you to load one or more tables from [Tabular Data Packages](http://frictionlessdata.io/docs/tabular-data-package/) directly into Power BI through the familiar 'Get Data' experience.
3
+
A Power BI [Custom Connector](https://docs.microsoft.com/en-us/power-bi/desktop-connector-extensibility#custom-connectors) based on the [Data Package M (datapackage-m)](https://github.com/nimblelearn/datapackage-m) functions. Data Package Connector enables you to load one or more tables from [Tabular Data Packages](http://frictionlessdata.io/docs/tabular-data-package/) directly into Power BI through the familiar 'Get Data' experience. It also includes the Data Package M functions library.
4
4
5
5
Not heard of Power BI? You can learn about it [here](https://docs.microsoft.com/en-us/power-bi/power-bi-overview).
6
6
@@ -36,13 +36,14 @@ Visit [https://frictionlessdata.io](https://frictionlessdata.io) to learn more.
36
36

37
37
*Full support for on demand and scheduled data refresh in the Power BI service (requires a Data Gateway)*
38
38
39
+

40
+
*Includes [Data Package M](https://github.com/nimblelearn/datapackage-m) functions for more advanced scenarios*
| DataPackage.Load | Returns a Navigation Table (i.e. `table`) that lists the [Data Resources](https://frictionlessdata.io/specs/data-resource/) contained within a Data Package. This function wraps DataPackage.Tables but expects the `ignoreTableSchemaTypes` parameter to be a `text` representation of a logical value instead of an actual `logical` value. The `text` value is casted to a `logical` value before calling DataPackage.Tables. See [Data Package M (datapackage-m)](https://github.com/nimblelearn/datapackage-m) to learn more about the DataPackage.Tables function.|
45
-
46
+
| DataPackage.Load | Returns a Navigation Table (i.e. `table`) that lists the [Data Resources](https://frictionlessdata.io/specs/data-resource/) contained within a Data Package. This function wraps DataPackage.Tables but expects the `ignoreTableSchemaTypes` parameter to be a `text` representation of a logical value instead of an actual `logical` value. The `text` value is casted to a `logical` value before calling DataPackage.Tables.|
46
47
47
48
### DataPackage.Load
48
49
@@ -53,6 +54,55 @@ Visit [https://frictionlessdata.io](https://frictionlessdata.io) to learn more.
53
54
54
55
Only data resources that are detected as being tabular (i.e. contain a `table` value in their 'Data' column) are returned by this function.
| DataPackage.Table | Returns a [Tabular Data Resource](https://frictionlessdata.io/specs/tabular-data-resource/) as a `table`|
62
+
| DataPackage.Tables | Returns a `table` that lists the [Data Resources](https://frictionlessdata.io/specs/data-resource/) contained within a Data Package |
63
+
| DataPackage.Helper | Returns a Data Package helper function as a `function`|
| dataPackageIdentifier | text | A valid [Data Package Identifier](https://frictionlessdata.io/specs/data-package-identifier/)|
79
+
| ignoreTableSchemaTypes | logical | Controls whether the [Table Schema](https://frictionlessdata.io/specs/table-schema/) is applied to the data |
80
+
81
+
Any Data Resource that is detected as being tabular will contain the data table in the 'data' column. Data Package properties that are inferred and added by Data Package M have their name preceded by double underscore e.g. '__fullpath'.
| functionName | text | A valid Data Package helper function name |
88
+
89
+
This is a special function that acts as a library of Data Package helper functions. As the returned functions are only used as helpers for the `DataPackage.Table` and `DataPackage.Tables` functions, please see the comments inline with the [Power Query M expressions](./DataPackage/DataPackageHelper.pqm) to understand how they work. Advanced Power Query M users may wish to use these helper functions to work with Data Package metadata more directly.
90
+
91
+
## Table Schema Type Conversions
92
+
93
+
Type conversion is attempted for the most common [Table Schema](https://frictionlessdata.io/specs/table-schema/) types:
94
+
95
+
| Table Schema Type | M Type |
96
+
| :-----------------| :------- |
97
+
| string | text |
98
+
| number | number |
99
+
| integer | number |
100
+
| boolean | logical |
101
+
| date | date |
102
+
| datetime | datetime |
103
+
| time | time |
104
+
105
+
Unhandled types are defaulted to the `text` type. Setting the `ignoreTableSchemaTypes` property to `true` when invoking `DataPackage.Load`, `DataPackage.Table`, or `DataPackage.Tables` will stop the Table Schema from being applied. This can be useful when one or more values in a column cause an error when the Table Schema type conversions are attempted.
56
106
57
107
## Setup
58
108
@@ -71,7 +121,91 @@ The thumbprint to use when setting up the Data Package Connector as a trusted th
71
121
3. Follow [these](https://docs.microsoft.com/en-us/power-bi/desktop-connector-extensibility) instructions on how to use Power BI Custom Connectors with Power BI Desktop.
72
122
4. Follow [these](https://docs.microsoft.com/en-us/power-bi/service-gateway-custom-connectors) instructions on how to use Power BI Custom Connectors with the Power BI On-premises Data Gateway.
73
123
74
-
124
+
## Power Query M Expression Examples
125
+
126
+
The following examples show the *recommended* way to invoke the Data Package M functions when using them in your Power Query M expressions.
127
+
128
+
#### Getting the List of Resources from a Data Package (Remote)
0 commit comments