Forum Discussion

bnisbet's avatar
bnisbet
Frequent Visitor
9 years ago
Solved

IF Statement Custom Column

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[ActualClo...
  • Sean's avatar
    9 years ago

    bnisbet

    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! :smileyhappy: