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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
srineo
Regular Visitor

M query to SQL

Hi all,

 

I use Import option and oracle SQL to pull data from source. Then i add few steps in powerbi to arrive final table data for visuals. I've also manually edited M query to include parameter in place of hardcoded literals in the original SQL statement. 

 

Problem is when i wanted to change the SQL logic i prefer Oracle SQL builder client to change/test my SQL then finally want to import in powerbi. I'm not able to view the orgianl SQL code which i imported in the 1st step to make any amendments. 

 

If i don't include the parameter in the M query then i can view the SQL code by double clikcing on 'source' step (1st step) whic is fine.  Is it a constraint that once I add parameter in the M query source code i no longer have access to original SQL code? Currently if any change to original SQL, i will have to start  a fresh Query in powerbi and repeat all the further steps which is not convinent if i have more steps. 

 

Or is there any tool to convert M query to SQL ?

 

Thanks,

Sri
Sri

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi srineo,

 

SQL statement is used to achieve data from database and load these data into power bi. Power Query is a built-in language which is often used to shape and transform data. So SQL statement can't replace M query. Inversely, the SQL statement is wrapped by M query function such as Sql.Database(server as text, database as text, optional options as nullable record). 

 

In addtion, if you are using query parameter in your sql statement, it means the table you achieved from database will be changed, every steps below should also be modified according to your requirement.

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi srineo,

 

SQL statement is used to achieve data from database and load these data into power bi. Power Query is a built-in language which is often used to shape and transform data. So SQL statement can't replace M query. Inversely, the SQL statement is wrapped by M query function such as Sql.Database(server as text, database as text, optional options as nullable record). 

 

In addtion, if you are using query parameter in your sql statement, it means the table you achieved from database will be changed, every steps below should also be modified according to your requirement.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.