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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PowerBIlearner
Frequent Visitor

Custom SQL instead of table or view

Hello,


Can you tell me how do I write the custom sql/ derived table to join to existing tables from the databases? I would like to be able to use derived table. The only options I see is I can use tables/views from the database. Thank you in advance.

 

@ankitpatira

@Greg_Deckler

@BhaveshPatel

@Seth_C_Bauer

@v-haibl-msft

@ImkeF

@Baskar

@Sean

 

Shruthi

2 ACCEPTED SOLUTIONS

@PowerBIlearner When you connect to the SQL Server you can expand the "Advanced options" and input a SQL query to pull in the data that you want.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

View solution in original post

v-qiuyu-msft
Community Support
Community Support

Hi @PowerBIlearner,

 

When we connect to SQL Server data source, we can use derived tables in the T-sql query, you can refer to the sample below:

 

q3.PNGq4.PNGq5.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-qiuyu-msft
Community Support
Community Support

Hi @PowerBIlearner,

 

When we connect to SQL Server data source, we can use derived tables in the T-sql query, you can refer to the sample below:

 

q3.PNGq4.PNGq5.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, it helped !

...and when you have 15 queries so that you want 15 datasets then you do the SQL conneciton 15 times - just genious on Microsoft's part (sarcasm) 

@PowerBIlearner When you connect to the SQL Server you can expand the "Advanced options" and input a SQL query to pull in the data that you want.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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