Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

To Generate Dates in a column using DAX

Hi All,

 

I have a Date field in my table.

I have to create 2 columns in the same table using below 2 logic's based on Date field.

 

Column 1-Logic 1:

If Date=today's date(20/05/2021) then it have to populate dates starting from 01/04/2021 till 20/05/2021.

 

Column 2-Logic 2:

If Date=today's date(20/05/2021) then it have to populate dates starting from 01/04/2020 till 20/05/2020.

 

Can anyone help me to acheive DAX for above 2 logics.

 

Thanks in Advance.

5 Replies

  • Anonymous ,

     

    New column=

    var _st = eomonth(Today(),-2)+1

    return

    concatenatex(calendar(_st, today),[Date],",")

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak ,

      Thanks for response.

      I don't want output to concatenate in a single row and it has to change dynamically with respective current date.

      Whatever might be the current date our start date should start from 1st of April .

      Need to populate the dates as shown in the screenshot from 1st April till Today's Date.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Can someone help me with the DAX for the above logics.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please show some sample data and expected result to us.

     

    Best Regards,

    Jay