Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

dax calendar eomonth min/max

hi all,

 

am trying to create a table with all dates of a year and did it like this:

yrCalendar= CALENDAR(EOMONTH(MIN('Treg'[ActivityDate]),-1)+1,EOMONTH(MAX('Treg'[ActivityDate]),0)) but i get an error message= The syntax for '.0' is incorrect. DAX(CALENDAR(EPOMONTH(MIN( etc etc))

Why do i get this message and what do i need to do to solve it.

thnx

Mrt

 

  • Hi Anonymous,

     

    Try this formula please.

    dCalendar02 =
    CALENDAR (
        EOMONTH ( MIN ( 'Time registration'[ActivityDate] ); -1 ) + 1;
        EOMONTH ( MAX ( 'Time registration'[ActivityDate] ); 0 )
    )

    Best Regards!

    Dale

16 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    Anonymous works find for me are you creating a new table?

    • Anonymous's avatar
      Anonymous
      Not applicable

      yes, want to create a new table.....

  • gooranga1's avatar
    gooranga1
    Icon for Power Participant rankPower Participant

    I just tried it on a test dataset here and it works okay

     

    dCalendar02 = CALENDAR(EOMONTH(min(Query1[event_timestamp]),-1)+1,EOMONTH(max(Query1[event_timestamp]),0))

    from your error message it would seem that that the error is because of a full stop before your zero rather than a comma in the final EOMONTH function?

    • Anonymous's avatar
      Anonymous
      Not applicable

      again, it s strange that someone else just informed me that for him/her it works.....

      this is my function:

      dCalendar02 = CALENDAR(EOMONTH(min('Treg'[ActivityDate]),-1)+1,EOMONTH(MAX('Treg'[ActivityDate]),0))

      what is strange is, is the fact that after i have entered my function, the comma next to the first ActivityDate is changed from a comma to a semi column....

      dCalendar02 = CALENDAR(EOMONTH(min('Treg'[ActivityDate]);-1)+1, etccc

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi Anonymous,

         

        It's hard for me to tell why the change happened. Formats in Power BI connect to "Formats" in the local computer. According to the error message "..syntax...", maybe it's something wrong with ";" or "," in the formula. (This picture just shows one example)

        BTW, the formula works well.

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Best Regards!

        Dale