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.
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...
Solved! Go to Solution.
Hi @MClerigo
This post describes it: https://www.thebiccountant.com/2017/07/23/transforming-a-column-with-values-from-another-column-in-p...
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @MClerigo
This post describes it: https://www.thebiccountant.com/2017/07/23/transforming-a-column-with-values-from-another-column-in-p...
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.