Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
shubhamrkrock
New Member

How to create field parameters in Power BI DirectLake Datasets using LIVE connection to Desktop?

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

3 REPLIES 3
Manoj_ejjada
New Member

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

  • Select Settings > Admin Portal
  • In Admin Portal select Power BI settings > Power BI Premium > Capacity name
  • Expand Workloads. In the XMLA Endpoint setting, select Read Write.

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

  • YourDataSetName’ with your dataset/semantic model name (Example: ‘SalesTerritory’)
  • YourWorkspaceName’ with your workspace name
  • Name of your field parameter table’ with your new field parameter table name to be created
  • [“’Table1nameInSemanticMode’[column_name]” with table name in your semantic model followed by column to be included in filed parameter table

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😊

 

jbauer22
Frequent Visitor

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.

lbendlin
Super User
Super User

You can't do anything with live connections.  At the minimum you need to convert them to Direct Query with local data model.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors