Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |