Hello Guys,
Pls help to adjust the code. Beginner struggles...
I'd like to do 2 things:
1) in #"Changed Type1" - dynamically provide type number to all column except the first one (this is date field)
- above code is referencing specific names but the number of columns is dynamic
2) in #"Rows Total" - add new column which is summing all columns except the first one (these are categories of data i dont need - just a sum of it)
As you can see before that i'm promoting headers from the first row so it should be taken into account.
Can you pls help? Appreciate a lot!
Pls help to adjust the code. Beginner struggles...
Power Query:
let
Source = Csv.Document(Web.Contents("https://api.llama.fi/simpleChainDataset/Terra?"),[Delimiter=",", Columns=1160, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Transposed Table" = Table.Transpose(Source),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Total", type number}, {"Terraswap", type number}, {"Protocol", type text}, {"Lido", type number}, {"Mirror", type number}, {"Anchor", type number}, {"Spectrum Protocol", type number}, {"LoTerra", type number}, {"Pylon Protocol", type number}, {"ApolloDAO", type number}, {"Nexus Protocol", type number}, {"Loop Finance", type number}, {"Starterra", type number}, {"Astroport", type number}, {"Stader", type number}}),
#"Rows Total" = Table.AddColumn(Source, "Sum", each List.Sum(List.Range(Record.ToList(_),2,Table.ColumnCount(Source)-2)))
in
#"Rows Total"
I'd like to do 2 things:
1) in #"Changed Type1" - dynamically provide type number to all column except the first one (this is date field)
- above code is referencing specific names but the number of columns is dynamic
2) in #"Rows Total" - add new column which is summing all columns except the first one (these are categories of data i dont need - just a sum of it)
As you can see before that i'm promoting headers from the first row so it should be taken into account.
Can you pls help? Appreciate a lot!