cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
kumarleau
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
v-ljerr-msft
Microsoft
Microsoft

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

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
v-ljerr-msft
Microsoft
Microsoft

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

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

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)
kumarleau
Frequent Visitor

Hello Experts, Any this.

 

Regards,

Kumar

@kumarleau,

 

Could you please share your sample code here?

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors