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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yodha
Helper IV
Helper IV

How to add next months to Current Date

Hi,

In my data i am generating DATE column using "DateTime.LocalNow()"  function. I would like to add future months (Jul,Aug,Sep...Dec) to this DATE column. Any help on this?

 

Thanks in Advance 

 

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @yodha , 

I am not sure your detailed requirement, did you want to create a date list from today to feature? If so, you could try below M code

let
    Source = List.Dates(DateTime.Date(DateTime.LocalNow()), 100, #duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    #"Converted to Table"

If not, please correct me and inform your expected output.

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi @yodha , 

I am not sure your detailed requirement, did you want to create a date list from today to feature? If so, you could try below M code

let
    Source = List.Dates(DateTime.Date(DateTime.LocalNow()), 100, #duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    #"Converted to Table"

If not, please correct me and inform your expected output.

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

If you are using M code so use the below :

Date.AddMonths(#date(2020, 1, 1), 12)

   Use the below link:

https://docs.microsoft.com/en-us/powerquery-m/date-addmonths

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

You can also create a calendar dimension using below Dax Table:

Calendar Dimension= Calendar ( Date(  2020,1,1), Date (2020,12,31))

So it will calendar table from 1st  Jan to 31st Dec 2020

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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