Forum Discussion

ValeriaBreve's avatar
ValeriaBreve
Post Partisan
3 years ago
Solved

Use a formula for a column name

Hello, I am trying to use a formula to call a column name to avoid tedious and long code rewriting (many years to compile....). In particular, I am reading the Year from the column name:  YearOfRe...
  • AntrikshSharma's avatar
    AntrikshSharma
    3 years ago

    ValeriaBreve You can use this - 

     

    GroupedRows = 
        Table.Group ( 
            #"Changed Type", 
            {"Product"}, 
            {
                {
                    "Amount", 
                    (Rows)=> // All Rows & Columns visible for the current Product
                    List.Sum (  
                        Table.Column ( 
                            Rows, 
                            "Jan" & Number.ToText ( Year ) & "Volume"  
                        )  
                    )
                } 
            }
        )