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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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

4 REPLIES 4
jbauer22
Advocate I
Advocate I

As of October, 2024 you can do live connection in Power BI desktop.  You can download your semantic model using the "Edit" button instead of the "Connect" button and export to a .PBIP file.  From there if you open the model in Power BI Desktop, you can got the Report icon in the left pane and there you will see Field Parameters enabled!!!  After publishing your changes are immediately updated in the Power BI Service (still in direct lake mode).  Here is the post for how to  live edit and export to PBIP: Live edit of Direct Lake models in Power BI Desktop | Microsoft Power BI Blog | Microsoft Power BI

Manoj_ejjada
Regular Visitor

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
Advocate I
Advocate I

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 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.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors
Top Kudoed Authors