pbiplint 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/NOTICE +29 -0
- package/README.md +57 -0
- package/dist/pbiplint.mjs +3377 -0
- package/package.json +48 -0
- package/sample/.pbi/editorSettings.json +8 -0
- package/sample/.platform +11 -0
- package/sample/definition/cultures/en-US.tmdl +2 -0
- package/sample/definition/database.tmdl +3 -0
- package/sample/definition/model.tmdl +24 -0
- package/sample/definition/relationships.tmdl +23 -0
- package/sample/definition/tables/Customer.tmdl +107 -0
- package/sample/definition/tables/Date.tmdl +99 -0
- package/sample/definition/tables/Employee.tmdl +83 -0
- package/sample/definition/tables/Product.tmdl +104 -0
- package/sample/definition/tables/Promotion.tmdl +70 -0
- package/sample/definition/tables/Sales.tmdl +165 -0
- package/sample/definition/tables/Store.tmdl +107 -0
- package/sample/definition.pbism +5 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
table Sales
|
|
2
|
+
lineageTag: e5dd0f16-ac53-567e-9fd5-189bf2d92f14
|
|
3
|
+
|
|
4
|
+
column 'Sale ID'
|
|
5
|
+
dataType: int64
|
|
6
|
+
isKey
|
|
7
|
+
lineageTag: 70a98324-671c-5529-9217-756c2fda75a9
|
|
8
|
+
summarizeBy: none
|
|
9
|
+
sourceColumn: Sale ID
|
|
10
|
+
|
|
11
|
+
annotation SummarizationSetBy = Automatic
|
|
12
|
+
|
|
13
|
+
column 'Sale Date'
|
|
14
|
+
dataType: dateTime
|
|
15
|
+
formatString: Long Date
|
|
16
|
+
lineageTag: 7f4ed934-60cc-55da-9d09-443a16c75b08
|
|
17
|
+
summarizeBy: none
|
|
18
|
+
sourceColumn: Sale Date
|
|
19
|
+
|
|
20
|
+
annotation SummarizationSetBy = Automatic
|
|
21
|
+
|
|
22
|
+
annotation UnderlyingDateTimeDataType = Date
|
|
23
|
+
|
|
24
|
+
column 'Product ID'
|
|
25
|
+
dataType: int64
|
|
26
|
+
lineageTag: 71545778-b268-596b-81b8-f792096cb975
|
|
27
|
+
summarizeBy: none
|
|
28
|
+
sourceColumn: Product ID
|
|
29
|
+
|
|
30
|
+
annotation SummarizationSetBy = Automatic
|
|
31
|
+
|
|
32
|
+
column 'Customer ID'
|
|
33
|
+
dataType: int64
|
|
34
|
+
lineageTag: 83c1d15d-889f-56b0-b27d-162c78253a9d
|
|
35
|
+
summarizeBy: none
|
|
36
|
+
sourceColumn: Customer ID
|
|
37
|
+
|
|
38
|
+
annotation SummarizationSetBy = Automatic
|
|
39
|
+
|
|
40
|
+
column 'Store ID'
|
|
41
|
+
dataType: int64
|
|
42
|
+
lineageTag: e16109a4-d939-505b-b0cd-20b4c3d592e3
|
|
43
|
+
summarizeBy: none
|
|
44
|
+
sourceColumn: Store ID
|
|
45
|
+
|
|
46
|
+
annotation SummarizationSetBy = Automatic
|
|
47
|
+
|
|
48
|
+
column 'Employee ID'
|
|
49
|
+
dataType: int64
|
|
50
|
+
lineageTag: 99144444-aea2-57c0-bfc8-df3f8f843022
|
|
51
|
+
summarizeBy: none
|
|
52
|
+
sourceColumn: Employee ID
|
|
53
|
+
|
|
54
|
+
annotation SummarizationSetBy = Automatic
|
|
55
|
+
|
|
56
|
+
column 'Promotion ID'
|
|
57
|
+
dataType: int64
|
|
58
|
+
lineageTag: 02d8dfb6-3a51-5af7-89b5-99d8d7671b99
|
|
59
|
+
summarizeBy: none
|
|
60
|
+
sourceColumn: Promotion ID
|
|
61
|
+
|
|
62
|
+
annotation SummarizationSetBy = Automatic
|
|
63
|
+
|
|
64
|
+
column Quantity
|
|
65
|
+
dataType: int64
|
|
66
|
+
lineageTag: 25de422f-c861-5a18-ac3b-fd90c45080b3
|
|
67
|
+
summarizeBy: none
|
|
68
|
+
sourceColumn: Quantity
|
|
69
|
+
|
|
70
|
+
annotation SummarizationSetBy = Automatic
|
|
71
|
+
|
|
72
|
+
column 'Unit Price'
|
|
73
|
+
dataType: decimal
|
|
74
|
+
lineageTag: 99d165f1-4665-5927-8368-bfa80820fad8
|
|
75
|
+
summarizeBy: none
|
|
76
|
+
sourceColumn: Unit Price
|
|
77
|
+
|
|
78
|
+
annotation SummarizationSetBy = Automatic
|
|
79
|
+
|
|
80
|
+
column 'Unit Cost'
|
|
81
|
+
dataType: decimal
|
|
82
|
+
lineageTag: 443d6657-f319-531e-b413-e16dca902a9d
|
|
83
|
+
summarizeBy: none
|
|
84
|
+
sourceColumn: Unit Cost
|
|
85
|
+
|
|
86
|
+
annotation SummarizationSetBy = Automatic
|
|
87
|
+
|
|
88
|
+
column 'Discount Amount'
|
|
89
|
+
dataType: decimal
|
|
90
|
+
lineageTag: 8e0a517a-cdb7-56fc-9705-7ff8b42933b8
|
|
91
|
+
summarizeBy: none
|
|
92
|
+
sourceColumn: Discount Amount
|
|
93
|
+
|
|
94
|
+
annotation SummarizationSetBy = Automatic
|
|
95
|
+
|
|
96
|
+
column 'Total Amount'
|
|
97
|
+
dataType: decimal
|
|
98
|
+
lineageTag: 64b9f067-3b01-5675-ae63-ed3e5c665328
|
|
99
|
+
summarizeBy: none
|
|
100
|
+
sourceColumn: Total Amount
|
|
101
|
+
|
|
102
|
+
annotation SummarizationSetBy = Automatic
|
|
103
|
+
|
|
104
|
+
column 'Net Amount'
|
|
105
|
+
dataType: decimal
|
|
106
|
+
lineageTag: 8a8bd9c9-529d-5cc2-ac18-8fb3886016d9
|
|
107
|
+
summarizeBy: none
|
|
108
|
+
sourceColumn: Net Amount
|
|
109
|
+
|
|
110
|
+
annotation SummarizationSetBy = Automatic
|
|
111
|
+
|
|
112
|
+
measure 'Total Sales' = SUM ( 'Sales'[Total Amount] )
|
|
113
|
+
lineageTag: ca8c39c8-04a5-56b1-898d-0a73736c3cca
|
|
114
|
+
|
|
115
|
+
measure 'Total Quantity' = SUM ( [Quantity] )
|
|
116
|
+
lineageTag: 3ac4e158-858b-5e1b-8289-78d12ceb80e2
|
|
117
|
+
|
|
118
|
+
measure 'Average Unit Price' = AVERAGE ( 'Sales'[Unit Price] )
|
|
119
|
+
lineageTag: 2b5680cc-3046-5e41-bc7f-f5ff360370b2
|
|
120
|
+
|
|
121
|
+
measure 'Total Cost' = SUM ( 'Sales'[Unit Cost] )
|
|
122
|
+
lineageTag: aef7aa67-b06e-5e59-ac93-136e4a872346
|
|
123
|
+
|
|
124
|
+
measure 'Total Discount' = SUM ( 'Sales'[Discount Amount] )
|
|
125
|
+
lineageTag: 6f6edc54-d408-5aea-a787-b48f4126590a
|
|
126
|
+
|
|
127
|
+
measure 'Net Sales' = [Total Sales] - [Total Discount]
|
|
128
|
+
lineageTag: e4e79507-12c0-5c58-8e25-12963846b787
|
|
129
|
+
|
|
130
|
+
measure 'Total Margin' = [Total Sales] - [Total Cost]
|
|
131
|
+
lineageTag: b9913bc2-aa66-55c0-8965-911b688f87dd
|
|
132
|
+
|
|
133
|
+
measure 'Margin %' = [Total Margin] / [Total Sales]
|
|
134
|
+
lineageTag: f9ffc38c-cd44-5852-b85a-0f7cbc8753f4
|
|
135
|
+
|
|
136
|
+
measure 'Order Count' = DISTINCTCOUNT ( 'Sales'[Sale ID] )
|
|
137
|
+
lineageTag: e8120ffb-3d8e-5701-a3b7-6c5e283a59a3
|
|
138
|
+
|
|
139
|
+
measure 'Average Order Value' = [Total Sales] / [Order Count]
|
|
140
|
+
lineageTag: df423b46-4a20-5b0c-8e7d-a87a163b2f7a
|
|
141
|
+
|
|
142
|
+
measure 'Distinct Customers' = DISTINCTCOUNT ( [Customer ID] )
|
|
143
|
+
lineageTag: ad0bf4d6-42d5-53d9-a887-1483c9167c06
|
|
144
|
+
|
|
145
|
+
measure 'Sales YTD' = TOTALYTD ( [Total Sales], 'Date'[Date] )
|
|
146
|
+
lineageTag: e501d2df-a69b-570d-a31d-d1bbfc8694a8
|
|
147
|
+
|
|
148
|
+
measure 'Sales LY' = CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
|
|
149
|
+
lineageTag: 5d4245d8-0c72-584f-bcd5-efbd492fc3a7
|
|
150
|
+
|
|
151
|
+
measure 'Sales YoY %' = ( [Total Sales] - [Sales LY] ) / [Sales LY]
|
|
152
|
+
lineageTag: 0f9d5832-20e8-584c-a5b3-fd670931d428
|
|
153
|
+
|
|
154
|
+
partition Sales = m
|
|
155
|
+
mode: import
|
|
156
|
+
source =
|
|
157
|
+
let
|
|
158
|
+
Source = Csv.Document(File.Contents("C:\Demo\Data\Sales.csv"), [Delimiter=",", Columns=13, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
|
|
159
|
+
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
|
|
160
|
+
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Sale ID", Int64.Type}, {"Sale Date", type date}, {"Product ID", Int64.Type}, {"Customer ID", Int64.Type}, {"Store ID", Int64.Type}, {"Employee ID", Int64.Type}, {"Promotion ID", Int64.Type}, {"Quantity", Int64.Type}, {"Unit Price", Currency.Type}, {"Unit Cost", Currency.Type}, {"Discount Amount", Currency.Type}, {"Total Amount", Currency.Type}, {"Net Amount", Currency.Type}})
|
|
161
|
+
in
|
|
162
|
+
#"Changed Type"
|
|
163
|
+
|
|
164
|
+
annotation PBI_ResultType = Table
|
|
165
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
table Store
|
|
2
|
+
lineageTag: 68ea7736-b37a-5ea0-a4c6-5c7c2d1685e6
|
|
3
|
+
|
|
4
|
+
column 'Store ID'
|
|
5
|
+
dataType: int64
|
|
6
|
+
isKey
|
|
7
|
+
lineageTag: d772858c-9da3-5ed6-a331-69110ad3d88d
|
|
8
|
+
summarizeBy: none
|
|
9
|
+
sourceColumn: Store ID
|
|
10
|
+
|
|
11
|
+
annotation SummarizationSetBy = Automatic
|
|
12
|
+
|
|
13
|
+
column 'Store Name'
|
|
14
|
+
dataType: string
|
|
15
|
+
lineageTag: db04fe37-723a-5f73-8c73-c3e59c032c36
|
|
16
|
+
summarizeBy: none
|
|
17
|
+
sourceColumn: Store Name
|
|
18
|
+
|
|
19
|
+
annotation SummarizationSetBy = Automatic
|
|
20
|
+
|
|
21
|
+
column 'Store Type'
|
|
22
|
+
dataType: string
|
|
23
|
+
lineageTag: 89246b7d-6a77-52b4-aec0-db23fbd320ba
|
|
24
|
+
summarizeBy: none
|
|
25
|
+
sourceColumn: Store Type
|
|
26
|
+
|
|
27
|
+
annotation SummarizationSetBy = Automatic
|
|
28
|
+
|
|
29
|
+
column City
|
|
30
|
+
dataType: string
|
|
31
|
+
lineageTag: e978760e-ef12-52f9-a9b2-990b9cfcec27
|
|
32
|
+
summarizeBy: none
|
|
33
|
+
sourceColumn: City
|
|
34
|
+
|
|
35
|
+
annotation SummarizationSetBy = Automatic
|
|
36
|
+
|
|
37
|
+
column State
|
|
38
|
+
dataType: string
|
|
39
|
+
lineageTag: f745b5b3-9516-59ea-b787-a1cefbb14dcc
|
|
40
|
+
summarizeBy: none
|
|
41
|
+
sourceColumn: State
|
|
42
|
+
|
|
43
|
+
annotation SummarizationSetBy = Automatic
|
|
44
|
+
|
|
45
|
+
column Region
|
|
46
|
+
dataType: string
|
|
47
|
+
lineageTag: 3f891fb2-0cfe-55cf-a1a6-00368278a561
|
|
48
|
+
summarizeBy: none
|
|
49
|
+
sourceColumn: Region
|
|
50
|
+
|
|
51
|
+
annotation SummarizationSetBy = Automatic
|
|
52
|
+
|
|
53
|
+
column Country
|
|
54
|
+
dataType: string
|
|
55
|
+
lineageTag: 67637f6b-0804-5534-a3c9-f8e11edffa46
|
|
56
|
+
summarizeBy: none
|
|
57
|
+
sourceColumn: Country
|
|
58
|
+
|
|
59
|
+
annotation SummarizationSetBy = Automatic
|
|
60
|
+
|
|
61
|
+
column 'Open Date'
|
|
62
|
+
dataType: dateTime
|
|
63
|
+
formatString: Long Date
|
|
64
|
+
lineageTag: cc4deb1f-e4db-5ee4-b9e8-1030e0646ba1
|
|
65
|
+
summarizeBy: none
|
|
66
|
+
sourceColumn: Open Date
|
|
67
|
+
|
|
68
|
+
annotation SummarizationSetBy = Automatic
|
|
69
|
+
|
|
70
|
+
annotation UnderlyingDateTimeDataType = Date
|
|
71
|
+
|
|
72
|
+
column Latitude
|
|
73
|
+
dataType: double
|
|
74
|
+
lineageTag: 7ffaf948-a30a-5eb6-9cf2-87f398d6cc12
|
|
75
|
+
summarizeBy: none
|
|
76
|
+
sourceColumn: Latitude
|
|
77
|
+
|
|
78
|
+
annotation SummarizationSetBy = Automatic
|
|
79
|
+
|
|
80
|
+
column Longitude
|
|
81
|
+
dataType: double
|
|
82
|
+
lineageTag: 189d5bb9-c0e7-5d7c-b042-a055d132b53a
|
|
83
|
+
summarizeBy: none
|
|
84
|
+
sourceColumn: Longitude
|
|
85
|
+
|
|
86
|
+
annotation SummarizationSetBy = Automatic
|
|
87
|
+
|
|
88
|
+
column 'Square Feet'
|
|
89
|
+
dataType: int64
|
|
90
|
+
lineageTag: 141763eb-e06f-5b38-b294-cd86fa50a4fe
|
|
91
|
+
summarizeBy: none
|
|
92
|
+
sourceColumn: Square Feet
|
|
93
|
+
|
|
94
|
+
annotation SummarizationSetBy = Automatic
|
|
95
|
+
|
|
96
|
+
partition Store = m
|
|
97
|
+
mode: import
|
|
98
|
+
source =
|
|
99
|
+
let
|
|
100
|
+
Source = Csv.Document(File.Contents("C:\Demo\Data\Store.csv"), [Delimiter=",", Columns=11, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
|
|
101
|
+
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
|
|
102
|
+
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", {{"Store ID", Int64.Type}, {"Store Name", Text.Type}, {"Store Type", Text.Type}, {"City", Text.Type}, {"State", Text.Type}, {"Region", Text.Type}, {"Country", Text.Type}, {"Open Date", type date}, {"Latitude", Double.Type}, {"Longitude", Double.Type}, {"Square Feet", Int64.Type}})
|
|
103
|
+
in
|
|
104
|
+
#"Changed Type"
|
|
105
|
+
|
|
106
|
+
annotation PBI_ResultType = Table
|
|
107
|
+
|