Forum Discussion
Copy and paste entire colum value to another column
Hi ,
Currently my table data looks like below
Since we are in October, It shows months from Oct to Next year Dec.
From Next month It shows months from Nov to Next year dec.
This input value column has to be replaced to column MAR-CFY only when it occurs.
Right now MAR-CFY column is not available, It appears When current month is Jan.
| Company | InputValue | Octcfy | Novcfy | Deccfy | Jannfy | Febnfy | Marnfy | Aprnfy | Maynfy | Junnfy | Julnfy | Augnfy | Sepnfy | Octnfy | Novnfy | Decnfy |
| 100 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 100 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
NFY refers to next finyear
If anyone has idea on this, could you help me ?Thanks in advance.
May be
= if List.Contains(Table.ColumnNames(#"Replaced Value"),"Mar-CFY")
then Table.ReplaceValue(#"Replaced Value", each [#"Mar-CFY"], each [Value], Replacer.ReplaceValue, {"Mar-CFY"})
else #"Replaced Value"Stéphane
5 Replies
- slorin
Super User
= Table.ReplaceValue(
Previous_Step,
each [InputValue],
each try [#"MAR-CFY"] otherwise [InputValue],
Replacer.ReplaceValue,
{"InputValue"}
)Stéphane
- GokilaRaviraj
Helper II
Hi slorin
I tried this, by replacing with oct-cfy to just check whether it is replacing or not.
It is not replacing the value and even Inputvalue field becomes 0.
I guess its because
Replacer.ReplaceValue,
{"InputValue"}Instead of Inputvalue, Mar-Cfy should come in place, It tried that, But it says Mar-cfy not found in table.
- GokilaRaviraj
Helper II
= Table.ReplaceValue(#"Replaced Value",each try [#"Mar-CFY"] otherwise [Value],each [Value],Replacer.ReplaceValue,{"Mar-CFY"})
This is formula i modified. It says Mar-CFY of the table wasn't found.
- slorin
Super User
May be
= if List.Contains(Table.ColumnNames(#"Replaced Value"),"Mar-CFY")
then Table.ReplaceValue(#"Replaced Value", each [#"Mar-CFY"], each [Value], Replacer.ReplaceValue, {"Mar-CFY"})
else #"Replaced Value"Stéphane
- GokilaRaviraj
Helper II