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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Islam
Helper V
Helper V

Asking About Date Function

Hey Experts

i have added a column to my query and add this step targeting type the date and time once a value is entered in items column, here is the formula:

#"Added Custom" = Table.AddColumn(#"Changed Type1", "تاريخ الادخال", each if [اسم الصنف] = ""
then ""
else if [اسم الصنف]<> "" then DateTime.LocalNow()
else null),

 

Item Name = "اسم الصنف"

each time i refresh the query date changes but i want it to be entered just one time when i enter an item name to the query and when i delete that item name date automatically delete, Any help:)

1 ACCEPTED SOLUTION

hi @v-juanli-msft  

thx man for help i just figured out that i can't enter the date only once when i enter data in a specified column like in excel built in function on VBA

View solution in original post

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @Islam 

each time i refresh the query date changes but i want it to be entered just one time when i enter an item name to the query and when i delete that item name date automatically delete, Any help:)

 

1. Do you want to show date instead of datetime after refreshing each time?

If you want date, please try Date.From(DateTime.LocalNow())

 

2.if you want to delete a column automatically, please refer to:

https://datachant.com/2016/12/09/remove-empty-columns-rows-from-table-in-excel-power-query/

 

Best Regards

Maggie

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

csadfasdfsda

hi @v-juanli-msft  

thx man for help i just figured out that i can't enter the date only once when i enter data in a specified column like in excel built in function on VBA

Anonymous
Not applicable

Hi @Islam ,

 

I have marked your reply as a solution, however, this is not precisely correct.

There is a workaround to achieve what you want using "incremental refreshes" - this should also work in Excel.

If you use this technique to preserve the existing data and only overlay changes the original date-time stamp will withstand consequent refreshes. 

 

Kind regards,

JB

Mariusz
Community Champion
Community Champion

Hi @Islam 

 

Power Query is designed to extract the data from different data sources, not to record or collect data therefore your best option would be to create the datestamp at the source.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

thx @Mariusz 

thanks for that bro but i was wondering if there is any reference for that topic and how to apply it

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors