cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nick001
Frequent Visitor

Import special columns from SQL Database

Hello, everyone,

 

I am again in the process of improving my data model and this time it is the import from a SQL server. I am currently loading the entire table from the server into PowerBi, and I only need two columns from the table. Is there a possibility, instead of using select *, to go to the two columns directly?

 

And 2nd question, could the list be restricted to certain import parameters? for example on the date?

 

many thanks and best regards Nick!

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Nick001 

And for Q1, you can only connect to the db table first, then use sql statement or remove others column  in power bi to get the 2 columns only.

 

Vpazhenmsft_0-1630550206919.png

 

Vpazhenmsft_2-1630550259648.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

3 REPLIES 3
mussaenda
Resident Rockstar
Resident Rockstar

Hi @Nick001 ,

 

you can work on using SQL statement as what @V-pazhen-msft stated.

Like

select

[column1],

[column2]

 

from

[dbname].[dbo].[tablename]

 

where

[date] filter/parameter goes here

 

--------------

hope this helps

V-pazhen-msft
Community Support
Community Support

@Nick001 

And for Q1, you can only connect to the db table first, then use sql statement or remove others column  in power bi to get the 2 columns only.

 

Vpazhenmsft_0-1630550206919.png

 

Vpazhenmsft_2-1630550259648.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

CNENFRNL
Community Champion
Community Champion

Value.NativeQuery() does the trick in your scenario; it works with intact SQL supported by your database.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors