Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

creating date/calendar table

Hi all, 

need some advice here, i am trying to follow the steps here

https://www.powerobjects.com/blog/2018/12/19/sorting-data-fiscal-year-power-bi/

but got this error: The following syntax error occurred during parsing: Invalid token, Line 3, Offset 10, “.

 

Can anyone advice

  • Hi Anonymous ,

     

    You may need to change the syntax "– 1" to "-1" in your formula in English input format, then it will work well.

     

    FYMonthNum = 
    VAR FYStartMonth = 4
    //Update the fiscal year starting month above *Use number between 1 to 12

    RETURN IF ( MONTH ( 'Date'[Date]) >= FYStartMonth,
    MONTH ( 'Date'[Date] )- ( FYStartMonth -1 ),
    12 + (MONTH ( 'Date'[Date] ) - (FYStartMonth -1 ) ) )

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

11 Replies

  • Anonymous I copied the code and it worked, I need to fix the double quotes. Can you copy DAX expression what you are using?

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k changed the double quotes and it worked!

      how abt step 2? I got error as well

      • parry2k's avatar
        parry2k
        Super User

        Anonymous can you share what expression are you using? I have no idea what is step 2.

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi Anonymous ,

     

    You may need to change the syntax "– 1" to "-1" in your formula in English input format, then it will work well.

     

    FYMonthNum = 
    VAR FYStartMonth = 4
    //Update the fiscal year starting month above *Use number between 1 to 12

    RETURN IF ( MONTH ( 'Date'[Date]) >= FYStartMonth,
    MONTH ( 'Date'[Date] )- ( FYStartMonth -1 ),
    12 + (MONTH ( 'Date'[Date] ) - (FYStartMonth -1 ) ) )

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi Anonymous  ,

     

    Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

     

    Best regards

    Amy