Forum Discussion
Anonymous
7 years agoNot applicable
Power Query - Change Type from a range os columns by position
Hello everyone! I´m trying to develop a personalized step to change the type of some columns in my table on Power Query that have the following structure (Table below). However, this code will b...
- 7 years ago
The function is also very simple, as it takes just one parameter (a table) as it's input. So you would adjust your query to this:
let Source = Table.Combine({#"fUsage-Peak (REF)", #"fUsage_Off-Peak (REF)", #"fCIP (REF)", #"fTotal Cost (REF)", #"fExcedente Energia Reativa P (REF)", #"fExcedente Energia Reativa FP (REF)", #"fDemand Contracted Off-Peak (VERDE) (REF)", #"fDemand Registered Peak (Actual Null) (REF)", #"fDemand Contracted Peak (VERDE) (REF)", #"fDemand Registered Off Peak (Actual Null) (REF)", #"fDemand Registered Peak (Dem Peak) (REF)", #"fDemand Registered Off Peak (Dem Peak) (REF)", #"fDemanda Contracted Peak (AZUL) (REF)", #"fDemanda Contracted Off Peak (AZUL) (REF)", #"fReactive Demand Peak (REF)", #"fReactive Demand Off Peak (REF)"}), ApplyFunction = FunctionName(Source)
in ApplyFunctionWhere "FunctionName" is the name of the query that holds the function code that you have copied.
Please see attached file.
ImkeF
7 years agoCommunity Champion
The function is also very simple, as it takes just one parameter (a table) as it's input. So you would adjust your query to this:
let
Source = Table.Combine({#"fUsage-Peak (REF)", #"fUsage_Off-Peak (REF)", #"fCIP (REF)", #"fTotal Cost (REF)", #"fExcedente Energia Reativa P (REF)", #"fExcedente Energia Reativa FP (REF)", #"fDemand Contracted Off-Peak (VERDE) (REF)", #"fDemand Registered Peak (Actual Null) (REF)", #"fDemand Contracted Peak (VERDE) (REF)", #"fDemand Registered Off Peak (Actual Null) (REF)", #"fDemand Registered Peak (Dem Peak) (REF)", #"fDemand Registered Off Peak (Dem Peak) (REF)", #"fDemanda Contracted Peak (AZUL) (REF)", #"fDemanda Contracted Off Peak (AZUL) (REF)", #"fReactive Demand Peak (REF)", #"fReactive Demand Off Peak (REF)"}),
ApplyFunction = FunctionName(Source)
in
ApplyFunction
Where "FunctionName" is the name of the query that holds the function code that you have copied.
Please see attached file.
Anonymous
7 years agoNot applicable
It worked!
Thank you so much for the help!