Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
faye_linturn
New Member

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

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @faye_linturn ,

 

Please add the custom column in Power Query Editor.

 

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

vkkfmsft_0-1660726371615.png

 

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.

View solution in original post

4 REPLIES 4
v-kkf-msft
Community Support
Community Support

Hi @faye_linturn ,

 

Please add the custom column in Power Query Editor.

 

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

vkkfmsft_0-1660726371615.png

 

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.

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

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

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
Most Valuable Professional
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. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.