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
eliasayy
Impactful Individual
Impactful Individual

Add 30 days to end of the month

Hello guys so i have a table with columns:

Date ,duedate, sale

 

The date column has normal dates like 8/16/2022

I want to add 30 days of end of each month we currently are in on the due date

 

So table should be

Date                duedate            sale

8/16/2022        9/30/2022         x

8/17/2022        9/30/2022         y

 

Duedate is like the end of august is august 31 last day of the month so if i add 30 days i get 30 September hence why due date should show 9/30/2022

 

I know the m code is Date.AddDays(#date(2022,8,30), 30) but i want it to always be the end of month so when i enter September, the due date should be 30 days of end of September which is 10/29/2022

 

i tried Date.AddDays(Date.EndOfMonth(DateTime.LocalNow(),30)) but kept giving me an error

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @eliasayy ,

 

DAX:

=
EOMONTH ( TODAY(), 0 ) + 30

 

M query:

= DateTime.Date(

    Date.AddDays(

        Date.EndOfMonth(DateTime.LocalNow()),30

    )

)

 

You miss a ) befor 30.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @eliasayy ,

 

DAX:

=
EOMONTH ( TODAY(), 0 ) + 30

 

M query:

= DateTime.Date(

    Date.AddDays(

        Date.EndOfMonth(DateTime.LocalNow()),30

    )

)

 

You miss a ) befor 30.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

amitchandak
Super User
Super User

@eliasayy , Due date a new column

= eomonth([Date],0) +30

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.

Top Solution Authors