Forum Discussion

MelbourneBadger's avatar
5 years ago
Solved

Dynamic GENERATESERIES

Hi All, 

How can I create a dynamic GENERATESERIES that will add by 1 at the start of each month? 

Thank you for the support before-hand. 

  • mahoneypat's avatar
    mahoneypat
    5 years ago

    Just put -1 instead of 0 on the initial EOMONTH

    Best regards

    Pat

4 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    I'm guessing this relates to your previous post.  If so, this should combine the two

     

    Calendar =
    VAR eomonthtoday =
        EOMONTH (
            TODAY (),
            0
        )
    VAR startdate =
        DATE ( 201911 )
    VAR series =
        GENERATESERIES (
            0,
            DATEDIFF (
                startdate,
                eomonthtoday,
                MONTH
            ),
            1
        )
    RETURN
        ADDCOLUMNS (
            series,
            "Date",
                EOMONTH (
                    startdate,
                    [Value]
                )
        )

     

    Regards,

    Pat

    • MelbourneBadger's avatar
      MelbourneBadger
      Helper I

      Thank you mahoneypat .

      Yes this relates to my question in the other thread. 

      This works, but how can I adjust the DAX such that the last end of the month date is from the previous month, ie. based on today's date, the last EOM date of the series is 31/10/2020? 

      Again thank you very much for your kind support. 

      • mahoneypat's avatar
        mahoneypat
        Microsoft Employee

        Just put -1 instead of 0 on the initial EOMONTH

        Best regards

        Pat