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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Do5779
Helper II
Helper II

"where (select...) " SQL in M / Queryeditor

Hello,

 

I have following issue:

 

Is in M a possibility to wirte a SQL statement with a "under-Select ", e.g. 

 

Select Databasemouse.Animal from Databasemouse
where (Select (Databasemouse.legs + Databasemouse.Arm)>2 from Databasemouse)

 

Databasemouse:

 

AnimalEnemyLegsArm
MouseSnake22
DogLion01
    

 

 

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

Hi, @Do5779 ;

I try it and you could create a sql ;

Select * from Databasemouse
where (Databasemouse.legs + Databasemouse.Arm)>2 

The final show:

vyalanwumsft_0-1668151381525.png


Best Regards,
Community Support Team _ Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @Do5779 ;

I try it and you could create a sql ;

Select * from Databasemouse
where (Databasemouse.legs + Databasemouse.Arm)>2 

The final show:

vyalanwumsft_0-1668151381525.png


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

AntrikshSharma
Super User
Super User

@Do5779 Do you want to convert a SQL code to M or just want to use SQL statement to load data into Power Query?

@AntrikshSharma ,

 

thank you for your respone. I only want to execute a SQL statement (advanced editor) with a "where select"-statement and I don't know why it isn't working.

@Do5779 If you are thinking about querying the table of an M code using SQL then that can't be done, if you are trying to query the Database using SQL then what is the error that you are getting?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.