Hi all,
Is there any way to import values only from a table, rather than formulas? My current code is:
= Excel.CurrentWorkbook(){[Name="Table1"]}[Content]
How would I rewrite this to bring in all calculated formulas as hard-coded values? The issue is this:
I have two tables I'm importing; one is the original table and all of its values should be hard-coded. The second table is a copy of the first where users make changes to the values; it includes formulas that update when changes are made by the user. The M-Code subtracts the values from these two tables from each other to determine the deltas between them. The issue is that Power Query is reading the second table's formulas as different from the first table's hard-coded values, even when they evaluate to the same result. Is there any way the second table's content could be read as the evaluated values rather than as its formulas?
Here is the full M-Code:
Is there any way to import values only from a table, rather than formulas? My current code is:
= Excel.CurrentWorkbook(){[Name="Table1"]}[Content]
How would I rewrite this to bring in all calculated formulas as hard-coded values? The issue is this:
I have two tables I'm importing; one is the original table and all of its values should be hard-coded. The second table is a copy of the first where users make changes to the values; it includes formulas that update when changes are made by the user. The M-Code subtracts the values from these two tables from each other to determine the deltas between them. The issue is that Power Query is reading the second table's formulas as different from the first table's hard-coded values, even when they evaluate to the same result. Is there any way the second table's content could be read as the evaluated values rather than as its formulas?
Here is the full M-Code:
Power Query:
let
Original = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Copy = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
Source = Original&Copy,
ReplacedValue = Table.ReplaceValue(Source,null,0,Replacer.ReplaceValue,List.Skip(Table.ColumnNames(Source),50)),
DateHeaders = List.Transform(List.Skip(Table.ColumnNames(ReplacedValue),50),each {_,(x)=>let first=Table.Column(x,_) in first{0}-first{1}}),
NonDateHeaders = List.FirstN(Table.ColumnNames(ReplacedValue),50),
Result = Table.Group(ReplacedValue,NonDateHeaders,DateHeaders),
in
Result