Forum Discussion

brinky's avatar
brinky
Helper IV
5 years ago
Solved

Custom month

Hello,

 

Any idea how to get month starting on the last day of prevouis month till end of the following month less 1 day in a calendar table?

Example month 4 April starts on 31/03/2021 & ends 29/04/2021.

 

Thanks in advance.

  • Hi, brinky 

    Please check the below picture and the formula to create a new column.

     

     

    Custom Month CC =
    MONTH('Table'[Date] +1)

     

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

3 Replies

  • Hi, brinky 

    Please check the below picture and the formula to create a new column.

     

     

    Custom Month CC =
    MONTH('Table'[Date] +1)

     

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, brinky 

    According to your description, do you mean that you want to get a dynamic calendar table based on the month of the current date with your logic?

    If so, I think you can try to use the EOMONTH() function in DAX to simply achieve this using a calculated table.

    You can create a calculated table like this:

    Calendar =
    
    var _startdate=EOMONTH(TODAY(),-1)
    
    var _enddate=EOMONTH(TODAY(),0)-1
    
    return
    
    CALENDAR(_startdate,_enddate)

     

    And you can get what you want like this:

     

    More info about the EOMONTH() function in DAX

    You can download my test pbix file below

     

    If this result is not what you want, you can explain your expected result in detail.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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