Forum Discussion
Artefx
10 years agoRegular Visitor
Converting from SQL to M
Hi, I am attempting to recreate a SQL query I have into M format so I can turn it into a function within PowerBI, but i'm having a little trouble. WITH RPL (PART, SUBPART, QUANTITY) AS
(
SEL...
- 10 years ago
my way of doing this (probably others) is to
1. drop the SQL in as normal,
2. edit query,
3. right click table in lefthand pane in query editor,
4. select advanced editor. you will then see the m version of your SQL.
Eric_Zhang
10 years agoMicrosoft Employee
The query in your post is a recursive query, the syntax is simple and easily reading. Converting it to "M" code just make things more complicated. May I know why do you have to do this? Due to the limitation on my knowledge on "M", so far I have no idea on how to convert it. But if you have to do that, I think this video Power Query User Defined Functions & Recursive Functions would give you a start.
Can you be more specific on your scenario, as I have more expertise on SQL, maybe we can achieve your requirement just by SQL.