Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
How to create field parameters in Power BI DirectLake Semantic Models (Datasets) using LIVE connection to Desktop?
Also, would Workspace Viewers be able to connect to Power BI Service Semantic Models (Datasets)?
I want to release self-serve analytics capabilities to my Org users who have Workspace Viewer access to my DirectLake Semantic Model, which has ADLS Gen 2 Delta lake shortcuts configured in a custom Semantic Model (I had to create a custom one connecting to the tables in the Fabric Lakehouse because the default Semantic Model doesn't allow creation of relationships between tables).
Tags: directlake, dataset, semantic model, relationships, custom datasets, custom semantic models, fabric, lakehouse, fabric lakehouse, LIVE, Power BI Desktop, field parameters, self serve, self service, self serve analytics, shortcuts, ADLS Gen 2
Field parameters can be created at the semantic model using notebooks in fabric for live query connections, this might not be the direct approach, but it works.
1. Enable XMLA endpoint property to read-write for your capacity(Semantic model connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft...)
2. Go to app.powerbi.com (make sure your direct lake semantic model is visible in Power BI service) and go to Data Engineering and go to your workspace.
3. To create a notebook, click on new > notebook.
4. Copy and paste the below code to install required package and import necessary modules.
%pip install semantic-link-labs
import sempy
from sempy_labs.tom import connect_semantic_model
5. After the required package and modules are imported hover below the result to add new code cell to the notebook.
6. copy paste the below code in the new cell (with correct indentation) to add field parameter to the semantic model.
datasetName = ‘YourDataSetName’
WorkspaceName = ‘YourWorkspaceName’
With connect_semantic_model(dataset = datasetName, readonly = False, workspace = WorkspaceName) as model:
FieldParameterTable = ‘Name of your field parameter table’
FieldsIncluded =[“’Table1nameInSemanticMode’[column_name]”, ”’Table1nameinsemanticmodel’[Columnname1]” , “’Table2nameInSemanticMode’[column_name2]”]
model.add_filed_parameter(table_name = FieldParameterTable, objects = FieldsIncluded)
Note: Make sure to correct the indentation for above code.
7. Replace
8. execute the cell and refresh your semantic model in power BI service, you will find a new field parameter table created.
If you have any queries/facing issues with implementation, feel free to message me on my LinkedIn
Accept this as solution if it helps you😊
I want this functionality too. Right now we can only do it in Tabular Editor. We would prefer to do it in the direct lake semantic model.
You can't do anything with live connections. At the minimum you need to convert them to Direct Query with local data model.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
87 | |
46 | |
25 | |
21 | |
19 |