Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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 5
Anonymous
Not applicable

Hi @Anonymous ,

 

Please show some sample data and expected result to us.

 

Best Regards,

Jay

Fsciencetech
Helper III
Helper III

amitchandak
Super User
Super User

@Anonymous ,

 

New column=

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

return

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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.

Harika1104_0-1621512973928.png

 

Anonymous
Not applicable

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.