Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hello Community,
As part of report migration to PowerBi. i am using Fabric Rest APIs (https://learn.microsoft.com/en-us/rest/api/fabric/semanticmodel/items/create-semantic-model?tabs=HTT...)
to create semantic layer.
here i have requirement like i need to provide direct query(i.e. SELECT USER_ID,FIRST_NAME,LAST_NAME,USER_NAME,ACTIVE_STATUS, MOBILE_NO, EMAIL_ID FROM app_users) to PowerBi and create semantic layer
can someone give idea using example if possible on how can i achieve this ?
Solved! Go to Solution.
Hello @UmeshGoti ,
Thank you for following up on my previous response.
No, you generally don't need to manually define the column details and table names if your SQL query is well-formed and includes all the necessary tables and columns.
Power BI will execute the query directly and infer the schema from the query's result. The columns and tables are automatically understood by Power BI based on the provided SQL.
Power BI usually infers the schema from the SQL query automatically. However, manual intervention might be needed if it struggles with complex queries or derived columns.
Prerequisites to Implement Semantic Model with Direct SQL Query in Power BI:
In a SQL query that pulls data from multiple tables, you typically use JOINs, subqueries, or other methods to combine the data. The most common approach is using JOIN statements.
Before calling the API, try to build the connection string and use that connection string with SQL query to call the API.
To send this request, use a POST method to the Power BI Fabric API using powershell or bash.
I hope this help you understanding, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Thanks @Anonymous
I got some idea on how can i proceed for my requirement, but still i need some help with the points you mentioned
Hello @UmeshGoti ,
Thank you for following up on my previous response.
No, you generally don't need to manually define the column details and table names if your SQL query is well-formed and includes all the necessary tables and columns.
Power BI will execute the query directly and infer the schema from the query's result. The columns and tables are automatically understood by Power BI based on the provided SQL.
Power BI usually infers the schema from the SQL query automatically. However, manual intervention might be needed if it struggles with complex queries or derived columns.
Prerequisites to Implement Semantic Model with Direct SQL Query in Power BI:
In a SQL query that pulls data from multiple tables, you typically use JOINs, subqueries, or other methods to combine the data. The most common approach is using JOIN statements.
Before calling the API, try to build the connection string and use that connection string with SQL query to call the API.
To send this request, use a POST method to the Power BI Fabric API using powershell or bash.
I hope this help you understanding, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi @UmeshGoti ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @UmeshGoti ,
I wanted to follow up on our previous suggestions regarding the issue. We would love to hear back from you to ensure we can assist you further.
If my response has addressed your query, please accept it as a solution and give a ‘Kudos’ so other members can easily find it. Please let us know if there’s anything else we can do to help.
Thank you.
Hi @UmeshGoti ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hello @UmeshGoti ,
Thank you for reaching out to the Microsoft Fabric community forum.
Thank you @rajendraongole1 for giving inputs.
To create a semantic layer in Power BI using the Fabric REST APIs, please follow these steps:
For more detailed information, please refer to the following documentation:
Items - Create Semantic Model - REST API (SemanticModel) | Microsoft Learn
Deploy a Power BI project using Fabric APIs - Microsoft Fabric REST APIs | Microsoft Learn
I hope my suggestions give you good ideas, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Thanks @rajendraongole1 for quick reply but i didn't get idea can you please explore more, that will help a lot.
if possible can you share documentation link for API POST https://api.fabric.microsoft.com/v1/semanticmodel/items
and request body in which we can pass SQL query.
Hi @UmeshGoti - you'll need to use Microsoft Fabric REST APIs to create a semantic model in Power BI and configure it to use DirectQuery against your database.
Use the Create Semantic Model API to define a new model in Power BI.
POST https://api.fabric.microsoft.com/v1/semanticmodel/items
More details :Power BI REST APIs semantic model permissions - Power BI | Microsoft Learn
Hope this link helps.
Proud to be a Super User! | |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.