Mixing program logic with presentation logic is not a good idea. Since SWICH is syntax sugar for nested IFs, it is equivalent to adding a number format parameter to an IF statement. SWITCH is not the right place for setting conditional number formats. The correct place is in conditional formatting. At the time of this comment, Excel has had the capability for ten years.
I'm afraid that the likelihood of this request being accepted is very low. M is a fairly strongly typed language by design. Strongly typed systems not support type coercion because it is dangerous and error prone. You must explicitly convert a number stored as text to a number, for example, if you want use the text number with other real numeric data.
I think the assumption is that you would create your query in an appropriate tool and just paste it in the window.
8 votesunder review · 2 comments · Power BI Ideas » Data Preparation · Flag idea as inappropriate… · Admin →
Great suggestion. I once suggested the creation of a log file when query folding occurs. Currently, there's no way to know what folded and what didn't, or if anything folded at all. Do all databases have a query profiler? Do all developers have access to this tool if one is available?
Thanks for the feedback! Sounds like a great feature for us to consider…
Does anyone else find this option useful? if so, please vote.
This request sounds similar to a feature that I once requested. In my case, I'd like to select a step that is eagerly executed. When testing a particularly complex script, currently you have to change the step name in the "in" portion of the script to test up to the step name.
However, this a troubleshooting request, and it's not something I expect to see before a true scripting editor is implemented in M.
We’re actively working on adding IntelliSense support for M authoring in the Advanced Query Editor, Formula Bar and Custom Column dialog. Expect to see these capabilities in one of our next few monthly updates, hopefully before the end of 2016. : )
In the beginning, I was quite puzzled that: 1) The "Advanced Editor" is not even a basic editor for M scripting (e.g. far less capable than Notepad V1.0)
2) M has about double the functions of Excel, yet there's no Intellisense
3) In recent times, proper case for default steps names was replaced with spaced names that end up with ugly and error prone characters in the resulting script.
Finally, it occurred to me that the "advanced" editor was designed as a way of viewing recorded steps and making light modifications. It was never designed to do anything substantial, like creating scripts from scratch, or making substantial modifications to recorded scripts.
I made my peace with the editor a long time ago when it became clear that it was not going to get better anytime soon (that was about two years ago, and it turned out to be true).
I get the syntax highlighting, function intellisense and all of the editing functionality that I need in NotePad++. The advanced editor is merely used to paste scripts created in NotePad++