Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hey,
Trying to create a Custom Column for an IF Calculation, but I keep getting an Error?
Finanical Year = IF ( MONTH (Opportunity[ActualCloseDate]) <4, "0", "1") + Year(Opportunity[ActualCloseDate])
Thanks!
Solved! Go to Solution.
What kind of error are you getting?
There's nothing wrong with this DAX formula (it should work with or without the quotes "0", "1" or 0, 1)
Financial Year = IF ( MONTH ( 'Calendar'[Date] ) < 4, "0", "1" ) + YEAR('Calendar'[Date])Are you maybe doing this in the Query Editor by any chance? There the syntax is different
https://msdn.microsoft.com/en-us/library/mt296606.aspx
Financial Year = (if Date.Month([Date]) < 4 then 0 else 1) + Date.Year([Date])
Hope this helps.
Good Luck! ![]()
Hi Guys,
I am trying to add a column that will contain if statment in query editor: if column Name contains a word "FALSE" than show me "False" if not show "n/a". At the minute I am getting a token literal error even if I only type =if.
I would be grateful for your help.
What kind of error are you getting?
There's nothing wrong with this DAX formula (it should work with or without the quotes "0", "1" or 0, 1)
Financial Year = IF ( MONTH ( 'Calendar'[Date] ) < 4, "0", "1" ) + YEAR('Calendar'[Date])Are you maybe doing this in the Query Editor by any chance? There the syntax is different
https://msdn.microsoft.com/en-us/library/mt296606.aspx
Financial Year = (if Date.Month([Date]) < 4 then 0 else 1) + Date.Year([Date])
Hope this helps.
Good Luck! ![]()
Yeah was trying to do it in Query Editor - Thanks for the link!
Much Appericated!!!
In the Query Editor - how would I apply a check to only run the IF, if the column contained data?
I'm not sure if this is what you're looking for...
Financial Year = if [Date] = null then null else (if Date.Month([Date]) < 4 then 0 else 1) + Date.Year([Date])
Good Luck! ![]()
Otherwise I suspect @MarcelBeug may have something to say! ![]()
Thanks @Sean
This would be an alternative:
Date.Year(Date.AddMonths([Date],9))
No need to test for null, if [Date] is null then the result will be null.
Works perfect thank you!
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 17 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 37 | |
| 29 | |
| 24 |