cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kumarleau Frequent Visitor
Frequent Visitor

Advance Editor dateadd function issue

Hi,

 

I am trying to do add a calculate column through advance editor by adding dateadd function to the date column.

It is giving me error that dateadd function was not recognized.

Please help me on this issue.

 

Regards,

Kumar

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
v-ljerr-msft Super Contributor
Super Contributor

Re: Advance Editor dateadd function issue

Hi @kumarleau,

 

It seems to be that you may mix DAX and Power Query(M). DATEADD function is a DAX function, so it cannot be used in Query Editor. You should use it under Modeling tab like below. Smiley Happy

 

c1.PNG

 

Regards

View solution in original post

MarcelBeug Super Contributor
Super Contributor

Re: Advance Editor dateadd function issue

Apparently you didn't understand the reply.

 

DATEADD is a DAX function. You can't use DAX functions in the query editor.

 

Instead, try Power Query (M) function Date.AddYears

 

Power Query (M) and DAX are 2 completely different languages within Power BI.

Specializing in Power Query Formula Language (M)

View solution in original post

5 REPLIES 5
kumarleau Frequent Visitor
Frequent Visitor

Re: Advance Editor dateadd function issue

Hello Experts, Any this.

 

Regards,

Kumar

SivaMani Senior Member
Senior Member

Re: Advance Editor dateadd function issue

@kumarleau,

 

Could you please share your sample code here?

Highlighted
v-ljerr-msft Super Contributor
Super Contributor

Re: Advance Editor dateadd function issue

Hi @kumarleau,

 

It seems to be that you may mix DAX and Power Query(M). DATEADD function is a DAX function, so it cannot be used in Query Editor. You should use it under Modeling tab like below. Smiley Happy

 

c1.PNG

 

Regards

View solution in original post

kumarleau Frequent Visitor
Frequent Visitor

Re: Advance Editor dateadd function issue

Hi,

 

Thanks for your reply.

 

let
    Source = Sql.Database("ebi-etl-dev-01", "dbname"),
    dbo_Report_Booking_Live = Source{[Schema="dbo",Item="Report_Booking_Live"]}[Data],
    OpportunityCreatedDate1 = dbo_Report_Booking_Live[OpportunityCreatedDate]
    OpportunityCreatedDate2=DateAdd(opportunityCreatedDate,-1,year)
in
    OpportunityCreatedDate1

MarcelBeug Super Contributor
Super Contributor

Re: Advance Editor dateadd function issue

Apparently you didn't understand the reply.

 

DATEADD is a DAX function. You can't use DAX functions in the query editor.

 

Instead, try Power Query (M) function Date.AddYears

 

Power Query (M) and DAX are 2 completely different languages within Power BI.

Specializing in Power Query Formula Language (M)

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 79 members 1,232 guests
Please welcome our newest community members: