Skip to content

Commit 38aba4a

Browse files
committed
Merge branch 'main' of https://github.com/sql-bi/Pbi-PushDataset into main
2 parents 94d28b8 + a24bafe commit 38aba4a

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,94 @@ There are three projects included in the repository:
99
* **PbiPushTools**: it is a command-line tool that internally uses the Sqlbi.PbiPushDataset library. This tool does not require programming skills to create, maintain, and test a push dataset model.
1010
* **Sqlbi.PbiPushTools**: it is a PowerShell cmdlet to create, maintain, and test a push dataset model. The cmdlet internally uses the Sqlbi.PbiPushDataset library and is an alternative to the command-line tool. This cmdlet does not require programming skills to create, maintain, and test a push dataset model. The PowerShell cmdlet is compatible with PowerShell scripts managed by Azure Functions. The cmdlet is available in the [PowerShell gallery](https://www.powershellgallery.com/packages/Sqlbi.PbiPushTools/).
1111

12+
## Sqlbi.PbiPushDataset
13+
The **[PbiConnection](https://github.com/sql-bi/Pbi-PushDataset/blob/main/Sqlbi.PbiPushDataset/PbiConnection.cs)** class is a wrapper of the push datasets features included in the Power BI REST API.
14+
The push dataset is created starting from a Tabular Object Model (TOM) structure, removing the unsupported features (like user hierarchies and inactive relationships).
15+
The push dataset can be initialized reading data from another Power BI dataset.
16+
The class handles service principal authentication and user authentication for the refresh operation.
17+
The class also includes a simulator that creates and write rows according to a configuration table.
18+
The public methods available are:
19+
* **CreatePushDataset**: Creates a push dataset in the specified workspace using the TOM model retrieved from a model.bim file.
20+
* **AlterPushDataset**: Updates the structure of a push dataset in the specified workspace using the TOM model retrieved from a model.bim file.
21+
* **ClearPushDataset**: Remove all the rows from one or all the tables of a push dataset
22+
* **RefreshWithDax**: Writes in tables of a push dataset the result obtained by running one or more DAX queries on another dataset published on the same Power BI tenant (also on a different workspace).
23+
* **PushSimulation**: Runs a simulation writing rows in one or more tables of a push dataset at intervals specified by the simulator configuration.
24+
25+
### Simulator configuration
26+
This is a sample of the simulator configuration file.
27+
* **batchInterval** is the number of seconds between each batch of rows generated.
28+
* **batchRows** is the number of rows generated in each batch.
29+
* **type** is the algorithm used to generate values for a column, can be **Fixed**, **List**, or **Range**.
30+
* **fixedValue** is the value assigned to a column for the **Fixed** algorithm
31+
* **allowedValues** is a list of values allowed for the **List** algorithm
32+
* **range** describe the range of valuesfor the **Range** algorithm:
33+
- **min** is the minimum value
34+
- **max** is the maximum value
35+
- **granularity** is the range granularity: use 0 for integers, 1 = 0.1, 2 = 0.01, -2 = multiple of 100
36+
```json
37+
{
38+
"batchInterval": 2,
39+
"tables": [
40+
{
41+
"name": "Sales",
42+
"batchRows": 98,
43+
"columns": [
44+
{
45+
"name": "Quantity",
46+
"type": "List",
47+
"allowedValues": [1,2,3,4,5,6,7,8,9,10]
48+
},
49+
{
50+
"name": "Net Price",
51+
"type": "Range",
52+
"range": {
53+
"min": 10.0,
54+
"max": 200.0,
55+
"granularity": 0
56+
}
57+
},
58+
{
59+
"name": "Unit Price",
60+
"type": "Range",
61+
"range": {
62+
"min": 200.0,
63+
"max": 2000.0,
64+
"granularity": 0
65+
}
66+
},
67+
{
68+
"name": "Order Date",
69+
"type": "Fixed",
70+
"fixedValue": "2020-03-05"
71+
},
72+
{
73+
"name": "StoreKey",
74+
"type": "List",
75+
"allowedValues": [550,999999,400,210,585,605,230,620,190,465,180,580,520,110,30,70,600]
76+
}
77+
]
78+
}
79+
]
80+
}
81+
```
82+
83+
## PbiPushTools
84+
The PbiPushTools command-line tool supports the following commands:
85+
* **clear**: Clear all the tables of a Push Dataset. Corresponds to the `Clear-PushDataset` verb of the PowerShell cmdlet.
86+
* **check**: Validate the model for a Push Dataset. Corresponds to the `Confirm-PushDataset` verb of the PowerShell cmdlet.
87+
* **generate**: Generate a model compatible with a Push Dataset. Corresponds to the `New-PushDataset` verb of the PowerShell cmdlet.
88+
* **publish**: Publish model as a Push Dataset. Corresponds to the `Publish-PushDataset` verb of the PowerShell cmdlet.
89+
* **alter**: Alter model published as a Push Dataset. Corresponds to the `Set-PushDataset` verb of the PowerShell cmdlet.
90+
* **refresh**: Refresh a Push Dataset executing specified DAX queries. Corresponds to the `Update-PushDataset` verb of the PowerShell cmdlet.
91+
* **simulate**: Simulate real-time updates to Push Dataset. Corresponds to the `Enter-PushDataset` verb of the PowerShell cmdlet.
92+
Use `PbiPushTools.exe -?` to get help and usage information. Add the command to get information about the parameters of each command. For example, `PbiPushTools.exe -? publish` shows the arguments for the publish command.
93+
94+
## Sqlbi.PbiPushTools
95+
The PowerShell cmdlet supports the following verbs:
96+
* **Clear-PushDataset**: Clear all the tables of a Push Dataset.
97+
* **Confirm-PushDataset**: Validate the model for a Push Dataset.
98+
* **Enter-PushDataset**: Simulate real-time updates to Push Dataset.
99+
* **New-PushDataset**: Generate a model compatible with a Push Dataset.
100+
* **Publish-PushDataset**: Publish model as a Push Dataset.
101+
* **Set-PushDataset**: Alter model published as a Push Dataset.
102+
* **Update-PushDataset**: Refresh a Push Dataset executing specified DAX queries.

0 commit comments

Comments
 (0)