Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Guys,
I'm trying to create a custom column to calculate adecemic year based on columns in my existing table...
if([month_logged] >= 8,[year_logged]&"-"&right([year_logged]+1,2), [year_logged]-1&"-"&right([year_logged],2))
However I seem to run into an error saying "Token RightParen expected". I'm sure I probably have the forumula wrong but I'm not sure how to take the above and make it work in Power BI.
Solved! Go to Solution.
heck my code in daxformatter, http://www.daxformatter.com/
normally indicates if there is an issue
when i put your code in there it doesnt seem to have any syntax issues, i am assuming you created this as a calculated column. Try breaking down each part of the code and see what you get
ie. i always put a column or measure name in the formatter otherwise it will take issue with it
test =
IF (
[month_logged] >= 8,
[year_logged] & "-"
& RIGHT ( [year_logged] + 1, 2 ),
[year_logged] - 1
& "-"
& RIGHT ( [year_logged], 2 )
)
Proud to be a Super User!
hi @dvnnvd,
Token RightParen expected. You seem to be creating a custom column in power query instead of creating a calculated one in DAX. They have different syntaxes. Attaching a screenshot of the error would be great.
Proud to be a Super User!
hi @dvnnvd,
Token RightParen expected. You seem to be creating a custom column in power query instead of creating a calculated one in DAX. They have different syntaxes. Attaching a screenshot of the error would be great.
Proud to be a Super User!
heck my code in daxformatter, http://www.daxformatter.com/
normally indicates if there is an issue
when i put your code in there it doesnt seem to have any syntax issues, i am assuming you created this as a calculated column. Try breaking down each part of the code and see what you get
ie. i always put a column or measure name in the formatter otherwise it will take issue with it
test =
IF (
[month_logged] >= 8,
[year_logged] & "-"
& RIGHT ( [year_logged] + 1, 2 ),
[year_logged] - 1
& "-"
& RIGHT ( [year_logged], 2 )
)
Proud to be a Super User!
Thank you,
I have done this but the main errors in my code seem to come from the use of "(" and ",". e.g. the Dax formatter throws the following errors
Syntax error, expected: columnId at line 1, col 4
Syntax error, expected: =, := at line 2, col 20
I think the code itself is okay, it's probably just my formatting so to speak. The code itself works fine in PowerPivot, just not Power BI.
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |