Skip to main content

Gold and Tabular

Overview

Load silver data into a gold analytical model (Power BI semantic model). The model YAML 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: Verkopen
Loadsettings:
- Notebook: T_Verkopen
SourceSchema: dbo
SourceTable: f_verkopen
TableType: Fact
Description: "Fact / Feit: Verkopen"
References:
- Table: Product
- Table: Kalender
Columns:
- SourceColumn: Quantity
Type: decimal(21,5)
IsHidden: true
Measures:
- Name: Totaal Verkoop
Expression: SUM(Verkopen[Quantity])
Description: "Totaal Verkoop"
FormatString: "#,##0.00"
DisplayFolder: Omzet

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

- Table:
Name: Kalender
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
- SourceColumn: Datum
Type: date
IsKey: true
- SourceColumn: Jaar
Type: int
- SourceColumn: Kwartaal
Type: varchar(10)
- SourceColumn: Maandnummer
Type: int
- SourceColumn: Maandnaam
OrderByColumn: Maandnummer
Type: varchar(20)
Measures:
- Name: Jaar 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('Kalender', 'Kalender'[Jaar] >= MinYear && 'Kalender'[Jaar] <= MaxYear))
RETURN CALCULATE(IF(COUNTROWS(Years)>0,1,BLANK()))
FormatString: GeheelGetal
- Name: "# Dagen per jaar"
Expression: |
CALCULATE(MAX(Kalender[Dagnummer jaar]), ALLEXCEPT(Kalender, Kalender[Jaar]))
FormatString: GeheelGetal

- 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
- SourceColumn: Omgeving
Type: varchar(50)

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
DatasetStringLakehouse 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.

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 Model5 is True.
  • easyfabric.data.Model
  • easyfabric.data.Table
  • easyfabric.data.Reference
  • easyfabric.data.Partition