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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

M IntelliSense autocomplete overwriting code

Scenario:

  • My formula bar contains a reference to a query (MyAsset in this example):
    Just a sample formulaJust a sample formula
  • I place the cursor before "MyAsset" and start typing (Table.B in this example):
    IntelliSense pops up as expectedIntelliSense pops up as expected
  • Let's say Table.Buffer is exactly what I want and I press Tab to autocomplete. At this stage Table.Buffer overwrites MyAsset too:
    Pressing Tab upon IntelliSense's suggestion overwrites what was to the right of the cursorPressing Tab upon IntelliSense's suggestion overwrites what was to the right of the cursor

Clearly I expect "My Asset" to stay, and it would be great if an opening parenthesis were added to be in line with DAX formula bar IntelliSense.

 

In general, when I press Tab after IntelliSense's suggestion, I expect it to work in the same way as autocomplete works in DAX formula bar: it should autocomplete the function name and add an opening parenthesis, if it's relevant for the item at hand. In this case, it should have been Table.Buffer(MyAsset instead of Table.Buffer only.

Status: Accepted
Comments
v-qiuyu-msft
Community Support

Hi @DMM , 

 

I have reported this issue internally: CRI 127944678. Will update here once I get any information. 

 

Best Regards,
Qiuyun Yu 

v-qiuyu-msft
Community Support
Status changed to: Accepted
 
v-qiuyu-msft
Community Support

Hi @DMM , 

 

Please see below information from PG team: 

 

The current behavior is by design, but we're looking to improve it in the future. Customer can open the suggestion on the Power BI ideas forum (but it is a known issue we are tracking internally). 

 

Best Regards,
Qiuyun Yu 

DMM
Advocate I
Advocate I

@v-qiuyu-msft When something is both by design and a known issue is a bit of oxymoron for me, so please tell the PG team that I strongly support their plans to improve this aspect of M IntelliSense. I don't think creating an idea is appropriate given that the PG team is aware of the issue and wants to improve it.

C4YNelis
Advocate III

I'd like to add that this functionality after all this time is still both one of the most helpful and one of the most annoying aspects of writing M query as far as I'm concerned. I'm really surprised this hasn't gotten more attention.

 

There are actually two aspects of writing with intellisense functionality that are both equally annoying imho. The first has been described above, which means that building up a formula from the inside out, is nearly impossible, since at times it just feels like fighting with the query editor, just to not have your code deleted (especially if you missed the fact that IS deleted a part of your code). I can hardly imagine anyone seriously suggesting to design this, this way. And even if that has been the case, I'd say, let us agree that the design is flawed as far as this goes. The name pretty much suggests it's intended behaviour, which it to sense in an intelligent way what is the most productive way of helping. That's clearly not happening right now. For me it became a trade-off, accepting both the pro's and cons or neither and deciding for myself which one I can best live with.

 

The second part is that the intellisense function also overwrites keywords, which imho should never be possible. So an easy and very helpful fix would be to only start suggesting an auto-completion after the keyword list has been eliminated. E.g. when writing something like if ... then .. else ... (it will autocomplete "then" and change it as soon as I press space, unless I escape the intellisense). The same for other keywords like "in" (which is something that comes up in literally every query you write at least once). Please take this seriously, even if this is an old thread already.

 

I'll write about the editor deleting my comments (still) in a different thread. Thank you for your time!

 

Cheers,

Niels