Syntax Error in DAX Measure Formula Results in Loss of Code - by Christopher Webb

Status : 


Sign in
to vote
ID 777128 Comments
Status Active Workarounds
Type Bug Repros 4
Opened 1/22/2013 1:55:23 AM
Access Restriction Public


When writing complex DAX measures in SSDT, whenever there's a syntax error SSDT reverts back to the last known good state of the measure. This is very frustrating because it often means that you lose a lot of code changes, which need to be re-entered, just because you made one error!
Sign in to post a comment.
Posted by Darren Gosbell on 1/22/2013 at 2:14 PM
I have a simpler repro.

1. In an Adventure Works database in FactResellerSales create a new measure with the following valid expression

Test Measure:=blank()

2. Hit enter so that SSDT will validate the expression

3. Now change it to the following (note there is a missing end bracket at the end of the expression)

Test Measure:=calculate(sum([SalesAmount]),FILTER(FactResellerSales,FactResellerSales[TaxAmt] = 0)

4. Hit the Enter key

This results in the following error

MdxScript(Model) (6, 134) The syntax for ';' is incorrect.

When you click "OK" the calculated measure reverts back to the expression from step 1. wiping out all your work and not giving you a chance to fix the syntax error.

What I expect is for the incorrect expression to be retained with a warning triangle so that I have an opportunity to correct the syntax error.
Posted by Kasper [MSFT] on 1/22/2013 at 10:23 AM
Hi Chris,

Thanks for filling this issue, we will investigate this.