Skip to content

Commit 8befbf8

Browse files
authored
Added description of Sqlbi.PbiPushDataset library
1 parent 598287c commit 8befbf8

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,73 @@ 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,420,290,670,300,80,510,590,610,430,440,450,35,200,540,170,90,650,380,50,240,570,100,220,270,370,560,500,490,360,330,630,140,470,10,255,660,340,310,40,130,530,390,160,410,480,320,260,74,60,150,120,72,280,20,250,350,460,580,520,110,30,70,600]
76+
}
77+
]
78+
}
79+
]
80+
}
81+
```

0 commit comments

Comments
 (0)