Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Formulas in a self referencing table

Hi, 

 

I have an issue where my excel formulas are always being overwritten when my query is refreshed. I know why this is happening, the columns are part of a self referencing table so the formula will always be overwritten with values.

 

So, when new rows are added the formula then does not populate down and I have to manually re add the fromula into excel (not in power query).

The formula is also not 'live'. One of the things I am looking at is days since - so how many days has an order been open (today()-order date=days open) but this does not recalculate. Today's value should be 1 but tomorrows value should be 2 etc. etc.

 

How can I get my formulas in a self referencing table to stay there and re-evaluate. I have heard of M code but at first galnce this is above my excel skills. 

I am unable to share the data as it confidential to my organisation. 

 

Thanks,

Faye

  • Hi Anonymous ,

     

    Please add the custom column in Power Query Editor.

     

    = Duration.Days( DateTime.LocalNow() - [order date] )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Most Valuable Professional

    You need to save your result as a seperate table, you should not overwrite the input table with your result table.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for this. How would I do that? My self ref table is saved as a connection only, does this need to be saved as something different so it loads to a new tab? Then I just hide the tabs for the self ref tables so they can't be seen

      • Vijay_A_Verma's avatar
        Vijay_A_Verma
        Most Valuable Professional

        If it is connection only, then no need.

        But I am unable to understand the issue now. Probably some more details are needed about this self referencing table/query. 

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi Anonymous ,

     

    Please add the custom column in Power Query Editor.

     

    = Duration.Days( DateTime.LocalNow() - [order date] )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.