Forum Discussion

BlueSky's avatar
BlueSky
Helper I
6 years ago
Solved

Generate a table with incremental values

So I'd like the table below:   Day Value 1 0 2 0.5 3 1 4 1.5 5 2   I can generate two different tables but can't bring them together, I'm guessi...
  • parry2k's avatar
    parry2k
    6 years ago

    BlueSky in power query , do the following:

     

    - add a blank query

    - click advanced editor

     

    and paste following code

     

    let
    
        #"Source" = Table.FromList({1..5}, Splitter.SplitByNothing(),{"index"},null, ExtraValues.Error),
        #"Added Index" = Table.AddIndexColumn(#"Source", "Factor", 0,0.5),
        #"Changed Type" = Table.TransformColumnTypes(#"Added Index",{{"index", Int64.Type}})
    in
        #"Changed Type"

     

    I would 💖 Kudos 🙂 if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

  • DataZoe's avatar
    6 years ago

    BlueSky You could do it this way, if you didn't want to do it in M:

     

    Table = ADDCOLUMNS(GENERATESERIES ( 0, 20, 0.5 ) ,"Day", divide([value],0.5)+1)