Forum Discussion
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
- amitchandak
Super User
Anonymous ,
New column=
var _st = eomonth(Today(),-2)+1
return
concatenatex(calendar(_st, today),[Date],",")
- AnonymousNot applicable
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.
- AnonymousNot applicable
Can someone help me with the DAX for the above logics.
- Fsciencetech
Helper III
Anonymous
Please check the below link
https://community.powerbi.com/t5/Community-Blog/For-and-While-Loops-in-DAX/ba-p/636314
- AnonymousNot applicable
Hi Anonymous ,
Please show some sample data and expected result to us.
Best Regards,
Jay