cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnwood
New Member

Converting an Excel source to SQL

Hi all

Using Power BI Desktop, i have created a series of dashboards which at present are sourcing data from a set of excel files created from various data sources, mainly Dynamics CRM.  I now want to convert from excel sources to direct SQL queries, without having ro revisit all my hard work!  Is there an easy way of doing this?

Many thanks!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User IV
Super User IV

The easiest/safest way to do this is to probably create a new query to your SQL data source in Desktop and get it to a state such that all of the columns are the same names, etc. Basically so that you have two queries, your original to Excel and the new one to SQL that end up with exactly the same end table. Edit your 2nd query and go to View | Advanced Editor. Copy the "M" code. Edit your 1st query and go to View | Advanced Editor. Select all of your "M" code and replace it with the paste of your 2nd query.

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

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Greg_Deckler
Super User IV
Super User IV

The easiest/safest way to do this is to probably create a new query to your SQL data source in Desktop and get it to a state such that all of the columns are the same names, etc. Basically so that you have two queries, your original to Excel and the new one to SQL that end up with exactly the same end table. Edit your 2nd query and go to View | Advanced Editor. Copy the "M" code. Edit your 1st query and go to View | Advanced Editor. Select all of your "M" code and replace it with the paste of your 2nd query.

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

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Many thanks!  As with manythings in life, it's obvious once you know how 🙂

PowerBIGuy
Responsive Resident
Responsive Resident

@johnwood if i understood the question correctly you can also just goto File <- Import Excel workbook contents on Power BI Desktop. This will convert your Excel Files into PBI Files as described here

Business Intelligence Architect / Consultant

Hi PowerBIGuy

What I am doing is using excel extracts from our CRM system to generate data on which I am developing our BI reports.  In order to move the project into a production environment, I wanted to convert the source type to a direct SQL query, and the reply I got from SMOUPRE is exactly teh answer I was looking for!

Thanks!

John

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Kudoed Authors