Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format Query (F6) doesn't work in Edit Measure Expression dialogue (new preview Query Builder) #347

Closed
BVMather opened this issue Jun 10, 2020 · 3 comments
Assignees

Comments

@BVMather
Copy link

In the Edit Measure Expression dialogue where you author a new measure in the new preview query builder, if you click Format Query (F6) to try to format the measure on its own it is not a valid DAX expression and you receive the error response from DAXFormatter.com

Syntax error, expected: +, -, *, /, ^, &, =, ==, >, <, >=, <=, <>, &&, ||, IN, .... etc

Of course a work around is to click 'Ok' and then run the formatter in the Edit Query pane, but perhaps the Format Query (F6) option should be disabled when the Edit Measure Expression dialogue is open, or you might consider the following:

Either the Format Query (F6) could be disabled, or perhaps you might 'wrap' the measure in a simple DEFINE MEASURE 'Table'[MyMeasure] = MyDAXMeasureExpresssion EVALUATE ROW("",[MyMeasure]) before posting it to DAXFormatter.com and then parse the response to only return the formatted MyDAXMeasureExpression

To Reproduce*

  1. Go to Query Builder

  2. Click on +New to add a new Measure

  3. Type a new DAX expression in the Edit Measure expression dialogue box

  4. Click on Format Query (F6)

  5. See error return from

  6. Scroll down to '....'

  7. See error

Expected behaviour
When you run Format Query (F6 ) in the Edit Measure Expression pane then the measure expression should be correctly formatted

@dgosbell
Copy link
Contributor

Thanks for reporting this. I actually just noticed this myself and have just checked in a fix. I will probably do a small point release in the next week or two for this.

perhaps you might 'wrap' the measure in a simple DEFINE MEASURE 'Table'[MyMeasure] = MyDAXMeasureExpresssion EVALUATE ROW("",[MyMeasure]) before posting it to DAXFormatter.com and then parse the response to only return the formatted MyDAXMeasureExpression

It's actually even simpler than this as daxformatter.com understands that an expression starting with "=" is a scalar expression. So I'm just injecting a leading "=" and then stripping it out. So one temporary work around is to do that manually until I get the update published.

@BVMather
Copy link
Author

Now that is fast!! 😁 Awesome new feature, thanks!

@dgosbell
Copy link
Contributor

just released v2.11.1 which should fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants