Skip to content

Commit

Permalink
Merge pull request #1 from mthierba/tmdl/preview-1
Browse files Browse the repository at this point in the history
TMDL Preview-1
  • Loading branch information
mthierba authored Dec 4, 2023
2 parents 2d4e3cf + 63562e4 commit 5247ed4
Show file tree
Hide file tree
Showing 20 changed files with 2,025 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TMDL/cultures/de-DE.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
culture 'de-DE'

11 changes: 11 additions & 0 deletions TMDL/cultures/en-US.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
culture 'en-US'
linguisticMetadata:
content:=
{
"Version": "1.0.0",
"Language": "en-US",
"DynamicImprovement": "HighConfidence"
}

contentType: Json

6 changes: 6 additions & 0 deletions TMDL/dataSources.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dataSource 'Structured Data Source'
connectionDetails:
protocol: tds
credential:
authenticationKind: ServiceAccount

27 changes: 27 additions & 0 deletions TMDL/expressions.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
expression '[SourceUrl]' = "https://raw.githubusercontent.com/" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=false]
queryGroup: Parameters

expression '[Version]' = "VERSION" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

expression '[CI-Branch]' = "CI-Branch" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

expression '[CI-Commit]' = "CI-Commit" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

expression '[CI-BuildNumber]' = "CI-BuildNumber" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

expression '[CI-BuildReason]' = "CI-BuildReason" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

expression '[Environment]' = "ENVIRONMENT" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

expression '[FilterDate]' = #date(2009, 1, 1) meta [IsParameterQuery=true, Type="Date", IsParameterQueryRequired=false]
queryGroup: Parameters

expression '[PBITOOLS_VERSION]' = "PBITOOLS_VERSION" meta [IsParameterQuery=true, Type="Text", IsParameterQueryRequired=true]
queryGroup: Parameters

24 changes: 24 additions & 0 deletions TMDL/model.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
model Model
compatibilityLevel: 1604
culture: en-US
dataAccessOptions:
fastCombine
legacyRedirects
returnErrorValuesAsNull
defaultPowerBIDataSourceVersion: PowerBI_V3
discourageImplicitMeasures
ID: b7d357fe-af44-4083-9e4d-2cb216640a3a
sourceQueryCulture: en-GB

queryGroup Parameters

annotation PBI_QueryGroupOrder = 0

annotation __PBI_TimeIntelligenceEnabled = 0

annotation PBIDesktopVersion = 2.106.883.0 (22.06)

annotation PBI_QueryOrder = ["Product","Date","Customer","Promotion","Sales","Store","[SourceUrl]","Info","[Version]","[GH-SHA]","[GH-RunId]","[Environment]","[GH-Branch]","[FilterDate]","[PBITOOLS_VERSION]"]

annotation TabularEditor_SerializeOptions = {"IgnoreInferredObjects":true,"IgnoreInferredProperties":true,"IgnoreTimestamps":true,"SplitMultilineStrings":true,"PrefixFilenames":false,"LocalTranslations":false,"LocalPerspectives":false,"LocalRelationships":false,"Levels":["Data Sources","Perspectives","Relationships","Roles","Shared Expressions","Tables","Tables/Calculation Items","Tables/Columns","Tables/Hierarchies","Tables/Measures","Tables/Partitions","Translations"],"AlsoSaveAsBim":true}

68 changes: 68 additions & 0 deletions TMDL/perspectives/Perspective 1.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
perspective 'Perspective 1'

perspectiveTable Customer
table: Customer.Customer

perspectiveColumn 'Address Line 1'
column: Customer.'Address Line 1'

perspectiveColumn 'Address Line 2'
column: Customer.'Address Line 2'

perspectiveColumn 'Cars Owned'
column: Customer.'Cars Owned'

perspectiveColumn 'Children At Home'
column: Customer.'Children At Home'

perspectiveColumn City
column: Customer.City

perspectiveColumn 'Company Name'
column: Customer.'Company Name'

perspectiveColumn CountryRegion
column: Customer.CountryRegion

perspectiveColumn 'Customer Code'
column: Customer.'Customer Code'

perspectiveColumn 'Customer Type'
column: Customer.'Customer Type'

perspectiveColumn CustomerKey
column: Customer.CustomerKey

perspectiveColumn 'Date First Purchase'
column: Customer.'Date First Purchase'

perspectiveColumn Education
column: Customer.Education

perspectiveColumn Gender
column: Customer.Gender

perspectiveColumn 'House Ownership'
column: Customer.'House Ownership'

perspectiveColumn 'Marital Status'
column: Customer.'Marital Status'

perspectiveColumn Name
column: Customer.Name

perspectiveColumn Phone
column: Customer.Phone

perspectiveColumn State
column: Customer.State

perspectiveColumn Title
column: Customer.Title

perspectiveColumn 'Total Children'
column: Customer.'Total Children'

perspectiveColumn 'Yearly Income'
column: Customer.'Yearly Income'

25 changes: 25 additions & 0 deletions TMDL/relationships.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
relationship '8c8b00e4-961a-489c-9a8b-812542526d79'
fromColumn: Sales.'Order Date'
toColumn: Date.Date

relationship 'cdc1f678-516d-402a-8bd3-13b1df211879'
fromColumn: Sales.'Delivery Date'
isActive: false
toColumn: Date.Date

relationship '56488b0e-a821-4cfc-bdd3-8cc68f36b536'
fromColumn: Sales.StoreKey
toColumn: Store.StoreKey

relationship '2ea9d16c-6bf3-4169-92f2-16b3d4c7e1b5'
fromColumn: Sales.PromotionKey
toColumn: Promotion.PromotionKey

relationship 'deca5bcb-ea8f-467a-b790-fa78ea247d57'
fromColumn: Sales.CustomerKey
toColumn: Customer.CustomerKey

relationship '930316a3-701f-46ba-8e96-262c3375b3c9'
fromColumn: Sales.ProductKey
toColumn: Product.ProductKey

13 changes: 13 additions & 0 deletions TMDL/roles/Role 1.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
role 'Role 1'

tablePermission Customer
metadataPermission: Read
table: Customer

tablePermission Product
metadataPermission: None
table: Product

tablePermission Date = [Calendar Year] > 2009
table: Date

124 changes: 124 additions & 0 deletions TMDL/tables/Calendar.tmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
table Calendar
dataCategory: Time
ordinal: 11

partition 'Date-2ef6d0e2-da8d-4267-af29-e2df30c25f7c' = Calculated
mode: Import
expression:=
VAR MinYear = YEAR ( MIN ( Sales[Order Date] ) )
VAR MaxYear = YEAR ( MAX ( Sales[Order Date] ) )
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Weekday number", WEEKDAY( [Date] ),
"Quarter", "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 12 ) + 1
)


column Date
dataType: DateTime
formatString:= General Date
isDataTypeInferred: false
isKey
sourceColumn: [Date]
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="DateTimeGeneralPattern"><DateTimes><DateTime LCID="1033" Group="GeneralDateTimeLong" FormatString="G" /></DateTimes></Format>

annotation DataTypeAtRefresh = DateTime#####not a type

column 'Calendar Year'
dataType: String
isDataTypeInferred: false
sourceColumn: "[Calendar Year]"
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="Text" />

annotation DataTypeAtRefresh = String#####not a type

column 'Month Name'
dataType: String
isDataTypeInferred: false
sortByColumn: 'Month Number'
sourceColumn: "[Month Name]"
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="Text" />

annotation DataTypeAtRefresh = String#####not a type

column 'Month Number'
dataType: Int64
formatString:= 0
isDataTypeInferred: false
sourceColumn: "[Month Number]"
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="NumberWhole" Accuracy="0" />

annotation DataTypeAtRefresh = Int64#####not a type

column Weekday
dataType: String
isDataTypeInferred: false
sourceColumn: [Weekday]
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="Text" />

annotation DataTypeAtRefresh = String#####not a type

column 'Weekday number'
dataType: Int64
formatString:= 0
isDataTypeInferred: false
sourceColumn: "[Weekday number]"
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="NumberWhole" Accuracy="0" />

annotation DataTypeAtRefresh = Int64#####not a type

column Quarter
dataType: String
isDataTypeInferred: false
sourceColumn: [Quarter]
summarizeBy: None

annotation SummarizationSetBy = Automatic

annotation Format = <Format Format="Text" />

annotation DataTypeAtRefresh = String#####not a type

annotation PBI_Id = b6a086042fa54ad08adef743517ab23e

extendedProperty Json =
{
"name": "SummarizationSetBy",
"value": "Automatic"
}


extendedProperty String = Lorem ipsum

Loading

0 comments on commit 5247ed4

Please sign in to comment.