Forum Discussion

santoshreddyk95's avatar
santoshreddyk95
Frequent Visitor
4 years ago
Solved

Adding Row data in new Column

Hi All,    I have a huge data base that has rows for every calendar date (almost 2 years of data) . I need the data of one calendar date in one column and other calendar date in other column while ...
  • v-jingzhang's avatar
    v-jingzhang
    4 years ago

    Hi santoshreddyk95 

     

    You want to calculate the increase/decrease between which two different dates? Every date and its previous date? If so, you can first duplicate the query.

     

    Then in the duplicated table, add a custom column to get the previous date. 

    Date.AddDays([Date],-1)

     

    Then merge queries to bring data from the original table into the duplicated table. Hold on Ctrl key and select "Previous Date" & "Item" columns as matching columns in duplicated table. In the second table, select "Date" and "Item" columns. 

     

    Expand the merged table column and select "Inventory" to add to the duplicated table. 

     

    You can then calculate the difference between two inventory columns to get the daily decrease/increase amount. 

     

    If you don't want to bring two tables' data into the data model, you can uncheck "Enable load" option for the original table. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.