cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdrammeh Member
Member

How to Add or Subtract Dates from a count of dates value?

Hello,

 

I am looking for assistance on how to solve the following functon in both Power BI and Power Query.

 

Thank you!Months Back Measure.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
v-ljerr-msft Super Contributor
Super Contributor

Re: How to Add or Subtract Dates from a count of dates value?

Hi @mdrammeh,

 

Based on my test, your formula should work in Query Editor, Custom Column under Add Column tab.

 

addmonth.PNG

 

Regards

3 REPLIES 3
Super User
Super User

Re: How to Add or Subtract Dates from a count of dates value?

You are trying to use Power Query "M" functions in DAX. You can't do that.

 

You want to use functions from here:

https://msdn.microsoft.com/en-us/library/ee634396.aspx

 

Specifically, probably the DATEADD function or something like it:

https://msdn.microsoft.com/en-us/library/ee634905.aspx

 

Refer to my blog article here on the Languages of Power BI

https://community.powerbi.com/t5/Community-Blog/The-Languages-of-Power-BI/ba-p/69104


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

v-ljerr-msft Super Contributor
Super Contributor

Re: How to Add or Subtract Dates from a count of dates value?

Hi @mdrammeh,

 

Based on my test, your formula should work in Query Editor, Custom Column under Add Column tab.

 

addmonth.PNG

 

Regards

mdrammeh Member
Member

Re: How to Add or Subtract Dates from a count of dates value?

Thanks for answering my question!

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 94 members 1,462 guests
Please welcome our newest community members: