Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Dax for creating date column for specific dates.

Hello,

Please anyone can tell me how can i create the dax column for date table as it will automatically add 1st date of every month 

like eg:-

Year & Month Identifier = {"01-January-2018","01-February-2018","01-March-2018","01-April-2018","01-May-2018","01-June-2018","01-July-2018","01-August-2018","01-September-2018","01-October-2018","01-November-2018","01-December-2018","01-January-2019","01-February-2019","01-March-2019","01-April-2019","01-May-2019","01-June-2019","01-July-2019","01-August-2019","01-September-2019","01-October-2019","01-November-2019","01-December-2019","01-January-2020","01-February-2020","01-March-2020","01-April-2020","01-May-2020","01-June-2020","01-July-2020","01-August-2020","01-September-2020","01-October-2020","01-November-2020","01-December-2020","01-January-2021","01-February-2021","01-March-2021","01-April-2021","01-May-2021","01-June-2021","01-July-2021","01-August-2021","01-September-2021","01-October-2021","01-November-2021","01-December-2021"}
i don't want to manually enter the dates.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    STARTOFMONTH(Tablename(datescolumn).[date])

     

    This function will give first date of each month in new column.

    • Anonymous's avatar
      Anonymous
      Not applicable

      No i want to create the table by not taking any value this the main date table no other date table is there.

  • Hi Anonymous 

     

    Try this code to add a new table:

    Table = 
    filter(CALENDAR(date(2018,1,1),Today()),day([Date])=1)

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi

      as mention in formula 

      Table = 
      filter(CALENDAR(date(2018,1,1),Today()),day([Date])=1)

      in my dataset date field is not there.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Create a table.

    Table = filter(CALENDAR(DATE(2021,1,1),TODAY()),DAY([Date])=1)

    Best Regards

    Community Support Team _ Polly

     

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