Forum Discussion
Maybrick1046
3 years agoFrequent Visitor
The Syntax for... is incorrect
I cannot for the life of me determine what is wrong with this statement. Any help appreciated
ValtteriN
3 years agoCommunity Champion
Hi,
var needs return in the end and then you can refer to the variable.
E.g. measure = var _a = 1
return
_a
So add: "return" and "data" and you are good
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Maybrick1046
3 years agoFrequent Visitor
Not working with the return
- ValtteriN3 years agoCommunity Champion
Hi, At a quick glance it seems you are missing closing ')' from your data variable.
- Maybrick10463 years agoFrequent Visitor
There are many variables, and if you notice, in the data table itself it's not finding the field name. Can I hire you to help me get this right?
- ValtteriN3 years agoCommunity Champion
Hi,
The reference is greyd out if the rest of the table syntax is not working. E.g. Here I tested some similar syntax in my machine:Measure 29 = var data =FILTER(SELECTCOLUMNS(ALLSELECTED('Table (15)'[Column1]),"x",'Table (15)'[Column1],"y",1),
NOT(ISBLANK([x])) && NOT(ISBLANK([y])))
var x_sum = SUMX(data,[x])var x2 = SUMX(data,[x]^2)var xy= SUMX(data,[x])var row_count = COUNTROWS(data)
return 1
This works without errors: