The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
i wrote simple nested if statement in power query editor.
it gives Token Eof expected error in highlighted possition. What is the reason
IF [Date.last.editted] > "01/04/2022" then "2022/2023"
else
IF [Date.last.editted] > "01/04/2021" then "2021/2022"
else
IF [Date.last.editted] > "01/04/2020" then "2020/2021"
else
IF [Date.last.editted] > "01/04/2019" then "2019/2020"
else
IF [Date.last.editted] > "01/04/2018" then "2018/2019"
else "2017/2018"
Solved! Go to Solution.
Hi - M/PowerQuery is case-sensitive, so it doesn't recognise "IF". Hopefully the below should work
if [Date.last.editted] > "01/04/2022" then "2022/2023"
else
if [Date.last.editted] > "01/04/2021" then "2021/2022"
else
if [Date.last.editted] > "01/04/2020" then "2020/2021"
else
if [Date.last.editted] > "01/04/2019" then "2019/2020"
else
if [Date.last.editted] > "01/04/2018" then "2018/2019"
else "2017/2018"
I hope that helps!
Hi - M/PowerQuery is case-sensitive, so it doesn't recognise "IF". Hopefully the below should work
if [Date.last.editted] > "01/04/2022" then "2022/2023"
else
if [Date.last.editted] > "01/04/2021" then "2021/2022"
else
if [Date.last.editted] > "01/04/2020" then "2020/2021"
else
if [Date.last.editted] > "01/04/2019" then "2019/2020"
else
if [Date.last.editted] > "01/04/2018" then "2018/2019"
else "2017/2018"
I hope that helps!