March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
Can anybody please tell me what 'token then expected' error means?
I have created the below formula (I am trying to allocated fiscal year to each month), but obviously I am doing something wrong.
Solved! Go to Solution.
You're using DAX syntax to write a function in M. The query editor uses a different language. It should be
=if [Month] > 9 then [Year] + 1 else [Year]
Proud to be a Super User!
This is referring to the proper set up of the if statement. It is not like excel. It needs a 'then' and and 'else' instead of commas.
It should be:
=if [Month]>9 then [year] + 1 else [year]
If in PQL follws this format:
= if <Logical_test> then <result> else <alternate_result>
Proud to be a Super User!
I figured it out nevermind. Once I removed all the ) before each of the thens the formula was accepted. Wish the error highlighted the ) parenthesis --calling it a token Then error is misleading bc the then is already there.
You're using DAX syntax to write a function in M. The query editor uses a different language. It should be
=if [Month] > 9 then [Year] + 1 else [Year]
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |