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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors