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 (10)
NameTypeDescription
DataCategoryStringClassification of the table
DescriptionStringDescription of the table
IsGeneratedtrue/falseIs the table included in the model
IsHiddentrue/falseIs the table hidden in the model
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
Reference
NameTypeDescription
Table *StringName of the related table
Show optional fields (1)
NameTypeDescription
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)
LoadLastPartitionsNullable<Int32>Used as an instruction for the loading of the partition. Not used for generating.
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.
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)
Clustered Index
NameTypeDescription
ColumnsString[]Columns for the index
DataCompressionStringCompression type for the index. (default=none)
FillFactorInt32Fill factor for the index. (default = 90)
OnlineStringBuild/Rebuild the index online (default = off)
StatisticsNoRecomputeStringStatistics no recompute (default = on)
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 (15)
NameTypeDescription
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
FormatStringStringFormat string of this field
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
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
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
Dax Derived Measure
NameTypeDescription
DerivedMeasure *StringName of the derived measure
Show optional fields (6)
NameTypeDescription
DescriptionStringOverride the description from the parent
DisplayFolderStringOverride the displayfolder from the parent
DocumentationStringOverride the documentation from the parent
FormatStringStringOverride the formatstring from the parent
IsHiddenNullable<true/false>Override the ishidden property from the parent
NameStringName of the derived measure
Tabular
NameTypeDescription
CompatibilityLevel *Int32n/a
DatasourceName *Stringn/a
TabularName *Stringn/a
Show optional fields (19)
NameTypeDescription
AccountStringn/a
AddMemberstrue/falsen/a
BimOutputpathStringn/a
ConnectionstringStringn/a
CultureStringn/a
DatabaseSchemaStringn/a
DatasourceTypeStringn/a
DefaultDatasourceStringn/a
DefaultPowerBiDataSourceVersionStringn/a
DimkeyPostfixStringn/a
DimkeyPrefixStringn/a
DimPrefixStringn/a
FactPrefixStringn/a
PlatformPowerUserRoleStringn/a
RolespathStringn/a
SourceQueryCultureStringn/a
TabularHiddenFolderStringn/a
TabularSystemFolderStringn/a
TransformationPrefixStringn/a
Derived Model
NameTypeDescription
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
DerivedMeasureStringn/a
DescriptionStringn/a
ExpressionStringn/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)

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_countboolDetermines if row counts should be logged during the process. Defaults to False.
key_violation_actionstrAction to be taken when key violations occur. Defaults to "raise".
destination_schemastrSchema of the destination table. Defaults to "dbo".
destination_tableOptional[str]Name of the destination table. 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 any other error occurs during the loading process and Model5 is set to True.
  • easyfabric.data.Model
  • easyfabric.data.Table
  • easyfabric.data.Reference
  • easyfabric.data.Partition