Skip to main content

Gold and Tabular

Overview

Load silver data into a gold analytical model (Power BI semantic modelThe "brain" of your data that tells Power BI how different pieces of information relate to each other.). The model YAMLA simple way to write configurations. It's basically a list that computers can read easily. defines tables, columns, measures, partitions, and references — and feeds two generator outputs (Fabric semantic model item AND BIM file) plus the runtime loader.

What gets generated

StageComponentOutput
BuildEasyFabric Generator (EFG)GenerateFabricDatamart, GenerateModel → Fabric semantic model + BIM file
RuntimeEasyFabric Runtime (EFR)easyfabric.load_data_gold.modelloader

Example YAML

Dataplatform/DP/Models/DM/model.yaml



- Table:
Name: Sales
Loadsettings:
- Notebook: T_Verkopen
SourceSchema: dbo
SourceTable: f_verkopen
TableType: Fact
Description: "Fact: Sales"
AIInstruction: "Central sales fact: one row per sold line item, additive over Quantity. Use for revenue and volume analysis sliced by Product, Customer and Calendar."
References:
- Table: Product
- Table: Calendar
- Table: Customer
Columns:
- SourceColumn: Quantity
Type: decimal(21,5)
IsHidden: true
Annotations:
- Name: DataSteward
Value: Sales Ops
Measures:
- Name: Total Sales
Expression: SUM(Sales[Quantity])
Description: "Total Sales"
FormatString: "#,##0.00"
DisplayFolder: Revenue

- Table:
Name: Customer
SourceSchema: dbo
SourceTable: d_klant
Loadsettings:
- Notebook: D_Klant
TableType: Dim
Columns:
- SourceColumn: firstname
Type: varchar(255)
- SourceColumn: lastname
Type: varchar(255)
- SourceColumn: emailaddress
Type: varchar(255)
- Name: Full Name
Expression: Customer[firstname] & " " & Customer[lastname]
Type: varchar(255)
DisplayFolder: Calculations

- Table:
Name: Product
SourceSchema: dbo
SourceTable: d_product
Loadsettings:
- Notebook: D_Product
TableType: Dim
Columns:
- Name: Product Name
SourceColumn: ProductName
Type: varchar(255)
- Name: Category
SourceColumn: Category
Type: varchar(255)

- Table:
Name: Calendar
SourceSchema: dbo
SourceTable: d_kalender
Loadsettings:
- Notebook: D_Kalender
TableType: Dim
DataCategory: Time
KeyDataType: int
Columns:
- Name: BK_Kalender
SourceColumn: BK_Kalender
Type: int
IsHidden: true
IsKey: false
- Name: Date
SourceColumn: Datum
Type: date
IsKey: true
- Name: CalendarInt
SourceColumn: KalenderInt
Type: int
IsHidden: true
- Name: Year
SourceColumn: Jaar
Type: int
- Name: Quarter
SourceColumn: Kwartaal
Type: varchar(10)
- Name: Month Number
SourceColumn: Maandnummer
Type: int
- Name: Month Name
SourceColumn: Maandnaam
OrderByColumn: Month Number
Type: varchar(20)
- Name: Month Name Short
SourceColumn: Maandnaam_kort
OrderByColumn: Month Number
Type: varchar(20)
- Name: Month Name Year
SourceColumn: Maandnaam_jaar
OrderByColumn: Year Month
Type: varchar(20)
- Name: Month Closed
SourceColumn: Maand_gesloten
Type: varchar(20)
DisplayFolder: Extra
- Name: Month Closing Date
SourceColumn: Maandsluitingsdatum
Type: date
DisplayFolder: Extra
- Name: Start of Current Month
SourceColumn: Start_huidige_maand
Type: date
DisplayFolder: Extra
- Name: Year Month
SourceColumn: Jaar_maand
Type: varchar(20)
- Name: Year Week
SourceColumn: Jaar_week
Type: varchar(20)
- Name: Week Number
SourceColumn: Weeknummer
Type: int
- Name: Year of Week
SourceColumn: Jaar_vd_week
Type: int
DisplayFolder: Extra
- Name: Day Number
SourceColumn: Dagnummer
Type: int
IsHidden: true
- Name: Day Number Year
SourceColumn: Dagnummer_jaar
Type: int
IsHidden: true
- Name: Day Number of Week
SourceColumn: Dagnummer_vd_week
Type: int
IsHidden: true
- Name: Day Number of Week Alt
SourceColumn: Dagnummer_vd_week_alt
Type: int
DisplayFolder: Extra
IsHidden: true
- Name: First Day of Month
SourceColumn: Eerste_dag_vd_maand
Type: date
DisplayFolder: Extra
IsHidden: true
- Name: Day Name
SourceColumn: Dagnaam
Type: varchar(20)
OrderByColumn: Day Number of Week
- Name: Day Name Short
SourceColumn: Dagnaam_kort
Type: varchar(5)
OrderByColumn: Day Number of Week
- Name: Is Current Year
SourceColumn: Is_huidig_jaar
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Year Complete
SourceColumn: Is_jaar_afgerond
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Current Year Period
SourceColumn: Is_huidig_jaarperiode
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Current Month
SourceColumn: Is_huidige_maand
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Month Complete
SourceColumn: Is_maand_afgerond
Type: varchar(20)
DisplayFolder: Extra
- Name: Is 3-Month Period
SourceColumn: Is_3maanden_periode
Type: varchar(10)
DisplayFolder: Extra
- Name: Is Current Week
SourceColumn: Is_huidige_week
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Week Complete
SourceColumn: Is_week_afgerond
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Future
SourceColumn: Is_toekomst
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Weekend
SourceColumn: Is_weekend
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Holiday
SourceColumn: Is_vakantie
Type: varchar(20)
DisplayFolder: Extra
- Name: Is Reporting Month
SourceColumn: IsRapportageMaand
Type: varchar(20)
- Name: Years From Current Year
SourceColumn: AantalJaarTovHuidigJaar
Type: int
- Name: Months From Current Month
SourceColumn: AantalMaandenTovHuidigeMaand
Type: int
Measures:
- Name: Year Filter
Expression: |
VAR TallyMin = Min(Tally[Tally Number integer]) + 0
VAR TallyMax = Max(Tally[Tally Number integer]) + 0
VAR MinYear = YEAR(NOW()) + TallyMin
VAR MaxYear = YEAR(NOW()) + TallyMax
VAR Years = CALCULATETABLE(FILTER('Calendar', 'Calendar'[Year] >= MinYear && 'Calendar'[Year] <= MaxYear))
RETURN CALCULATE(IF(COUNTROWS(Years)>0,1,BLANK()))
FormatString: Integer
- Name: "# Days per year"
Expression: |
CALCULATE(MAX('Calendar'[Day Number Year]), ALLEXCEPT('Calendar', 'Calendar'[Year]))
FormatString: Integer

- Table:
Name: Tally
SourceSchema: dbo
SourceTable: d_tally
Loadsettings:
- Notebook: D_Tally
TableType: Dim
Columns:
- SourceColumn: TallyNumber
Type: varchar(50)
- Name: Tally Number integer
SourceColumn: TallyNumberInt
IsHidden: true
Type: int
- Name: Environment
SourceColumn: Omgeving
Type: varchar(50)

- Table:
Name: Time Intelligence
TableType: CalculationGroup
CalculationGroupColumn: Time Calculation
Description: Time intelligence calculations applied across measures
CalculationItems:
- Name: Current
Expression: SELECTEDMEASURE()
Description: Current value of the measure
Ordinal: 0
- Name: YTD
Expression: |
CALCULATE(SELECTEDMEASURE(), DATESYTD('Calendar'[Date]))
Description: Year-to-date total
Ordinal: 1
- Name: Prior Year
Expression: |
CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Calendar'[Date]))
Description: Value of the same period last year
Ordinal: 2
- Name: YoY %
Expression: |
VAR _current = SELECTEDMEASURE()
VAR _prior = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Calendar'[Date]))
RETURN DIVIDE(_current - _prior, _prior)
FormatStringDefinition: '"0.0%"'
Ordinal: 3

Schema reference

Required fields marked *. Linked types are collapsible — click to expand inline.

Tabular Model

NameTypeDescription
Columns *List<TabularColumn>List of columns in the model
Name *StringName of the table in the tabular model
TableType *StringType of the table in the model
Show optional fields (14)
NameTypeDescription
AIInstructionStringAI-addressed instruction for the table. Surfaced in the wiki graph and never emitted to Power BI / Excel. When set it overrides Description as the graph instruction value; when both are empty the graph omits the field.
DataCategoryStringClassification of the table
DescriptionStringDescription of the table
GoldTableSettingsFabricTableSettingsTable Settings for Gold
IsGeneratedtrue/falseIs the table included in the model
IsHiddentrue/falseIs the table hidden in the model
LoadsettingsList<LoadSetting>Notebook(s) that produce the gold table for this Tabular table. Consumed by the graph emitter to draw notebook -> gold-table lineage edges; ignored by SQL/TMSL generation.
MeasuresList<DaxMeasure>List of measures in the model
PermittedRolesString[]Roles that have permission to use this table
ProhibitedRolesString[]Roles that are not allowed to use this table
ReferencesList<Reference>Relations to other tables in the model
SourceSchemaStringSchema of the table in the source database (default=dm)
SourceTableStringName of the table in the source database
SurrogateKeyUnknownValueStringDefault value for surrogate key when no match is found, default also used for GUID fields. (default from Configuration)
Reference
NameTypeDescription
Table *StringName of the related table
Show optional fields (4)
NameTypeDescription
AIInstructionStringAI-addressed instruction for this relationship. Surfaced in the wiki graph; omitted when empty. Reference has no Description, so there is no fallback.
ColumnStringColumnname of the fact table. Dimension column will remain equal. Only necessary for multiple relationships to the same dimension. IsActiveRelation is mandatory when supplied.
IsActiveRelationtrue/falseIs this relation active? (default=true)
MultiDirectionalFiltertrue/falseIs this both way relation? Use with caution. (default=false)
Hierarchies
NameTypeDescription
LevelsString[]A list of levels to add to the hierarchy (use the names from the tabular model
NameStringName of the hierarchy
Partition
NameTypeDescription
PartitionSource *StringThe (onelake) sourceobject, depends on datasourcetype that is used
Show optional fields (16)
NameTypeDescription
GroupNameStringThe name of the partition. Should be unique per tabular table. Based on the config this name will be extended with the properties set elsewhere.
HasPartitionLeftOvertrue/falseCreate a leftover partition when using a partitiontype like (yyyyMM, yyyy, yyyyMMdd). It will create > then last partition (default=true)
IsGeneratedInDataplatformtrue/falseIs this partition created in the dataplatform model. Set to false, for a view or a custom implementation. Make sure the requested field are available (default=true)
IsGeneratedInTabulartrue/falseIs this partition created in the tabular model (default=true)
IsHistorytrue/falseIs this partition used for history purposes. This can be used by the loading mechanism to skip this partition. (default=false)
ModeStringThe mode that is used for reading the data into tabular (import, directquery or default). Only import is supported (default=import)
NameStringn/a
PartitionEndNullable<Int32>End - Start determines how many partitions that will be created. Also taking into account the size of every partition.
PartitionFilterStringThe filter that should occur on the sourceobject. Provide without WHERE, depends on datasourcetype that is used (example=MyCustomField='LoadThis'
PartitionFilterColumnStringThe filter is applied on the column, provided here and should exists in the underlying datasource.
PartitionIsHistoryNullable<Int32>The number of generated (oldest) date partitions that are categorised as history. History partitions are annotated so the loading mechanism can skip them except on a first or full load. (default=0)
PartitionProcessingEndStringUsed as an instruction for the loading of the partition. Not used for generating the partition
PartitionSchemaStringThe schema of the sourceobject, depends on datasourcetype that is used
PartitionSizeNullable<Int32>The size of every partition. In other words, how many to skip, before creating another partition. Default = 1
PartitionStartNullable<Int32>The partition value to start with when creating the partition. Depending on PartitionType, Size and End it will help with generating the partitions.
PartitionTypePartitionTypesThe partitiontype is used to determine the kind of partition is created. More info in the tutorial. (default=All)
Tabular Column
NameTypeDescription
SourceColumn *StringSourcecolumn name, if name is not supplied, this name is used. Automatically camelcase script is applied.
Type *StringType of the field in the model
Show optional fields (18)
NameTypeDescription
AIInstructionStringAI-addressed instruction for the field. Surfaced in the wiki graph and never emitted to Power BI / Excel. When set it overrides Description as the graph instruction value; when both are empty the graph omits the field.
ClassificationStringClassification of this field. Set to sensitive for fields that should be handled with care.
ColumnSqlFunctionStringBefore loading this column into tabular, use a scalar function on this column. Should be used for masking for example. Can make loading slow. Function should exist in database. Format is fn_YourFunction(0). The column name will be filled into 0
DataCategoryStringData category of the column
DataTypeStringDatatype of the column. Will be converted to Fabric datatype.
DescriptionStringDescription of the field, used in BI-tools like Power BI and Excel
DisplayFolderStringFolder for this field, used in BI-tools like Power BI and Excel
EncodingHintStringEncoding Hint for columns (Default=Default)
FormatStringStringFormat string of this field
IsAvailableInMdxtrue/falseSet to false if not used in MDX clients for slicing and filtering
IsHiddentrue/falseField is hidden from the model (can still be queried)
IsKeytrue/falseField is used as the primary key for this table (default=false)
IsUniquetrue/falseField contains unique values (default=false)
NameStringName of the field in the model, use to override the automatic generated name based on sourcecolumn.
OrderByColumnStringThe field on which this field should order.
PermittedRolesString[]Roles that have permission to use this field
ProhibitedRolesString[]Roles that have no permission to use this field
SummarizeMeasureStringSet the summarization for this field (sum, max, avg etcetera). Use measures instead.
Dax Measure
NameTypeDescription
AIInstructionStringAI-addressed instruction for the measure. Surfaced in the wiki graph and never emitted to Power BI / Excel. When set it overrides Description as the graph instruction value; when both are empty the graph omits the field.
AnnotationsList<Annotation>Custom name/value annotations emitted onto the measure. The EF_ prefix is reserved for EasyFabric-internal annotations.
DataCategoryStringData category for the measure
DerivedMeasuresList<DaxDerivedMeasure>List of derived measures based on this measure
DescriptionStringExplanation of the measure, will be shown on the mouse over in Power BI. When not provided, the DAX is presented
DisplayFolderStringFolder where the measure will be shown in the user interface of BI-tools like Power BI and Excel
DocumentationStringPlace for documentation. Not used for generating anything at the moment.
ExpressionStringDAX expression for the measure
ExpressionFileStringDAX expression for the measure, based on a file
FormatStringStringFormat string for the measure
FormatStringDefinitionStringFormat string definition in case of Dynamic formatting for the measure
FormerNameStringFor renaming, provide a formername and a copy with that will be created, so reports will remain working.
IsHiddentrue/falseHide the measure in the user interface of BI-tools like Power BI and Excel
IsSimpleMeasuretrue/falseIs the measure a simple measure, like a column in a table, or a measure that is based on a DAX expression
NameStringName of the measure
Overridetrue/falseOnly used in a derived model. When a measure with the same name already exists in the base model, set Override to true to replace it; otherwise generation fails so the clash is not silently ignored.
Dax Derived Measure
NameTypeDescription
DerivedMeasure *StringName of the derived measure
Show optional fields (9)
NameTypeDescription
DataCategoryStringData category for the measure
DescriptionStringOverride the description from the parent
DisplayFolderStringOverride the displayfolder from the parent
DocumentationStringOverride the documentation from the parent
FormatStringStringOverride the formatstring from the parent
FormatStringDefinitionStringFormat string definition in case of Dynamic formatting for the measure
IsHiddenNullable<true/false>Override the ishidden property from the parent
NameStringName of the derived measure
ParametersList<Dictionary<String, String>>Parameters can be supplied by the calling measure
Tabular
NameTypeDescription
CompatibilityLevel *Int32Compatibility level of the tabular model (default=1600)
DatasourceName *StringName of the datasource (default=DefaultDS)
TabularName *StringName of the tabular model
Show optional fields (33)
NameTypeDescription
AccountStringn/a
AddMemberstrue/falseAdd members to the roles from role file (default=false)
BimOutputpathStringPath where the bim file is saved
ConnectionstringStringn/a
CultureStringn/a
DatabaseSchemaStringn/a
DatasetStringLakehouseA place where you store both "raw" data (like files) and "organized" data (like tables). It combines the best of a File Cabinet and a Database. dataset, for fabric connections
DatasourceTypeStringDatasourcetype to set the source to Azure SQL or Fabric
DefaultDateFormatStringStringFormat string applied to date columns (not datetime) that have no explicit FormatString. Default "dd-MM-yyyy".
DefaultEncodingHintKeyColumnsStringDefault Encoding Hint for Key columns (Default=value)
DefaultEncodingHintRegularColumnsStringDefault Encoding Hint for regular columns (Default=default)
DefaultPowerBiDataSourceVersionStringn/a
DimBusinesskeyPostfixStringPostfix of the businesskey column for the dimension
DimBusinesskeyPrefixStringPrefix of the businesskey column for the dimension
DimkeyPostfixStringPostfix of the keycolumn for the dimension. Will become obsolete. (Default=""
DimObjectPrefixStringDimension table prefix, for example D_.
DimSurrogatekeyPrefixStringPrefix of the keycolumn for the dimension, will be replaced by DimSurrogatekeyPrefix
EffectiveDimTablePrefixStringn/a
EffectiveFactTablePrefixStringn/a
EffectiveSKPrefixStringn/a
EffectiveTransformationObjectPrefixStringn/a
FactObjectPrefixStringFact table prefix, for example F_. Will be replaced by FactTablePrefix
HideSurrogateKeystrue/falseHide Surrogate keys in the model. Only disable when really needed. Will override other settings on the visibility! (default=True)
NormalizeAttributeNamestrue/falseFor special cases (like ontology) names should not contain certain characters. Will override other settings for labels of attributes! (default=False)
PlatformPowerUserRoleStringn/a
RolespathStringRelative path to the roles file
SetIsAvailableInMdxtrue/falseWhen true, columns marked hidden or key are set NOT available in MDX. When false (default) every column is available in MDX.
SourceQueryCultureStringn/a
SurrogateKeyUnknownValueStringDefault value for surrogate key when no match is found. (default='8C6BAD1B-71F9-FC31-EAB8-543E81F77571')
TabularHiddenFolderStringFoldername for hidden items in the tabular model
TabularSystemFolderStringFoldername for system items in the tabular model
TransformationObjectPrefixStringPrefix for transformation objects, for example T_
TransformationPrefixStringPrefix for transformation objects, will be replaced by TransformationObjectPrefix
Derived Model
NameTypeDescription
MeasuresList<DaxMeasure>n/a
TableStringn/a
Format Strings
NameTypeDescription
FormatStringStringn/a
FriendlyNameStringn/a
IsDefaulttrue/falsen/a
NameStringn/a
Measure From File
NameTypeDescription
ExpressionStringn/a
FileNameStringn/a
Measure Template
NameTypeDescription
DataCategoryStringn/a
DerivedMeasureStringn/a
DescriptionStringn/a
DisplayFolderStringn/a
ExpressionStringn/a
FormatStringStringn/a
IsHiddenNullable<true/false>n/a
MeasureNameStringn/a
Custom Roles
NameTypeDescription
AliasStringn/a
DaxfiltersList<Daxfilter>n/a
GroupsString[]n/a
MembersString[]n/a
NameStringn/a
Daxfilter
NameTypeDescription
ExpressionStringn/a
TableStringn/a

EasyFabric Runtime

load_data_gold.modelloader

def modelloader(data_frame: DataFrame,
load_config: LoadConfig,
model_config: Model,
config_manager: ConfigManager = None) -> str | None

Loads data into the gold layer of a data platform using the specified configurations and model.

This function handles loading a DataFrame into the data platform's "gold" layer. It configures logging, saves metadata, and uses the provided model configuration to apply necessary transformations and loading procedures. Proper initialization of LoadConfig, Model, and ConfigManager is required before calling this function.

Arguments:

  • data_frame DataFrame - The data to be loaded into the platform.
  • load_config LoadConfig - Configuration settings for the loading process.
  • model_config Model - Model configuration required for transformations and validations.
  • config_manager ConfigManager - Manages configuration details and ensures proper initialization.
LoadConfig fields

Runtime parameter bag — construct in code and pass to the loader. All fields are optional unless flagged below.

FieldTypeDescription
_layerstrOperational layer associated with the configuration. Defaults to "not set".
dry_runboolIndicates if the process should be executed in dry-run mode. Defaults to True.
auto_null_columnboolDetermines if null values should be automatically managed for columns. Defaults to True.
load_typeLoadTypeSpecifies the type of load operation. Defaults to LoadType.FULL.
stop_at_errorboolSpecifies whether the process should stop when an error occurs. Defaults to True.
business_key_checkboolIndicates if business keys should be validated during the load. Defaults to True.
log_row_countboolDeprecated and ignored. Row counts are always logged; retained for backward compatibility. Defaults to False.
key_violation_actionstrAction to be taken when key violations occur. Defaults to "raise".
load_history_tableboolWhen true, also load the object's history table alongside the main table. Defaults to False.
model_object_nameOptional[str]Specifies the model object name used in operations. Defaults to None.
merge_delete_queryOptional[str]The query for handling delete scenarios during merge operations. Defaults to None.
destination_full_tablenameOptional[str]Fully qualified destination table name (schema.table) the load writes to. Defaults to None.

Returns:

  • str - A string indicating the outcome of the loading process, or None if successful.

Raises:

  • Exception - If load_config.model_object_name is missing.
  • Exception - If config_manager is not properly initialized.
  • Exception - If model_config is not provided.
  • Exception - If an error occurs during processing and config_manager.stop_at_error is True.
  • easyfabric.data.Model
  • easyfabric.data.Table
  • easyfabric.data.Reference
  • easyfabric.data.Partition