-
Notifications
You must be signed in to change notification settings - Fork 149
Home
m-kovalsky edited this page Feb 16, 2025
·
11 revisions
Welcome to the semantic-link-labs wiki!
import sempy_labs as labs
dataset = '' # Enter the name or ID of your semantic model
workspace = None # Enter the name or ID of the workspace in which the semantic model resides
labs.run_model_bpa(dataset=dataset, workspace=workspace)
labs.run_model_bpa(dataset=dataset, workspace=workspace, extended=True)import sempy_labs as labs
dataset = '' # Enter the name or ID of your semantic model
workspace = None # Enter the name or ID of the workspace in which the semantic model resides
labs.vertipaq_analyzer(dataset=dataset, workspace=workspace)Connecting to the Tabular Object Model (TOM)
from sempy_labs.tom import connect_semantic_model
dataset = '' # Enter the name or ID of your semantic model
workspace = None # Enter the name or ID of the workspace in which the semantic model resides
with connect_semantic_model(dataset=dataset, workspace=workspace, readonly=True) as tom:
for t in tom.model.Tables:
for c in t.Columns:
print(f"'{t.Name}'[{c.Name}]")import sempy_labs as labs
dataset = '' # Enter the name or ID of your semantic model
workspace = None # Enter the name or ID of the workspace in which the semantic model resides
labs.refresh_semantic_model(dataset=dataset, workspace=workspace)
labs.refresh_semantic_model(dataset=dataset, workspace=workspace, tables = ['Sales', 'Geography'])
labs.refresh_semantic_model(dataset=dataset, workspace=workspace, tables = ['Geography', 'Calendar'], partitions = ["'Sales'[SalesFY2025]", "'Sales'[SalesFY2025]")
labs.refresh_semantic_model(dataset=dataset, workspace=workspace, visualize=True)import sempy_labs as labs
labs.list_connections()import sempy_labs as labs
workspace = None # Enter the name or ID of the workspace
labs.list_shortcuts(workspace=workspace)from sempy_labs import admin
admin.list_activity_events(start_time="2025-02-15T07:55:00", end_time="2025-02-15T08:55:00", activity_filter="viewreport")from sempy_labs import admin
admin.list_tenant_settings()Show tables within a lakehouse
import sempy_labs.lakehouse as lake
lakehouse = None
workspace = None
lake.get_lakehouse_tables(lakehouse=lakehouse, workspace=workspace)Show columns within all tables within a lakehouse
import sempy_labs.lakehouse as lake
lakehouse = None
workspace = None
lake.get_lakehouse_columns(lakehouse=lakehouse, workspace=workspace)Rebind a report to a different semantic model
import sempy_labs.report as rep
report = '' # Name or ID of the report
dataset = '' # Name or ID of the semantic model to bind to the report
report_workspace = None # Name or ID of the workspace in which the report resides
dataset_workspace = None # Name or ID of the workspace in which the semantic model resides
rep.rebind_report(report=report, dataset=dataset, report_workspace=report_workspace, dataset_workspace=dataset_workspace)