Forum Discussion

s15's avatar
s15
Helper III
9 years ago
Solved

Addition assignment operator formula in Power BI

Hi guys,   I need to create a column that uses Addition assignment operator starting at "1999". I need to create such a column with 16 row (from 1999 - 2014). Does Power BI Formula support such a c...
  • MarcelBeug's avatar
    9 years ago

    Not sure if you are looking for DAX or Power Query.

     

    In Power Query you can create a table from scratch or you can add a custom index column starting at 1999 with increments of 1.

    I did both, resulting in the following code. The first line was added via the advanced editor; the second line was generated by choosing Add Column - Index Column - Custom:

     

    let
        Source = Table.FromColumns({{1999..2014}},type table[FromScratch = Int64.Type]),
        #"Added Index" = Table.AddIndexColumn(Source, "AddedAsCustomIndex", 1999, 1)
    in
        #"Added Index"