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

Expression.Error: We cannot apply field access to the type Date.

Hi, I'm trying to change values in a column, based from another column. In more detail, I have a column "Date", and another column "Index". I want to add "Index" months to the "Date".

I know I can create a new column, based from Date+Index, and then delete the first two, but it's a waste of processing.

 

I have already this formula:

= Table.TransformColumns(#"ChangeDate",{{"DataDoc", each (Date.AddMonths([DataDoc],each [Index])) }})

but it gives me this error:

Expression.Error: We cannot apply field access to the type Date.

 

Help... 

1 ACCEPTED SOLUTION
Super User II
Super User II

2 REPLIES 2
Super User II
Super User II

YEAH MAN!

Thanks very much.

Following your lead, I came up with:

 

= Table.ReplaceValue(#"ChangeDate",each [DataDoc],each (Date.AddMonths([DataDoc],[Index])),Replacer.ReplaceValue,{"DataDoc"})

 

Exactly what I was searching for. Just looking with the wrong angle.

Thanks again!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

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

Top Solution Authors
Top Kudoed Authors