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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Generating Dates

Hi All,

 

I have a Date field in my table.

I have to create a new column based on date field.

 

Logic: If date=today's date then it have to populate dates starting from April till today's date.

 

Ex: Toda's Date=19/05/2021 then it have to populate dates starting from 01/04/2021 till 19/05/2021.

 

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

What's the expected result, Something like below?

Column = IF('Table'[date]>TODAY()||'Table'[date]<DATE(2021,4,1),BLANK(),'Table'[date])

6.PNG

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

What's the expected result, Something like below?

Column = IF('Table'[date]>TODAY()||'Table'[date]<DATE(2021,4,1),BLANK(),'Table'[date])

6.PNG

 

Best Regards,

Jay

amitchandak
Super User
Super User

@Anonymous , you can not do it in column you can create table of dates

 

New Table =
var _month = month(Today())
var _year = if(_month <4, year(Today())-1, year(Today()))
var _st = date(_year,4,1)
return
calendar(_st, today())

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

Hi Amit,

Thanks for your response.

 

From my end a small correction in logic:

If today's Date=19/05/2021

then it have to populate dates starting from 01/04/2020 till 19/05/2020.

 

Do we have any alternative approach to arrive it as column instead of table.

 

 

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.