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
obriaincian
Resolver I
Resolver I

How to import excel creation date from sharepoint into data table in Power BI

Hi,

 

I have an excel sheet in sharepoint that I want to import into power bi, I would also like to create a column once it's imported to store the date the file was created.

 

I have several steps in power query to filter for the correct excel.

 

The creation date of the file can be seen in the "Filtered Rows 2" below, is there a way I can create a new step after the "Added Custom" Step to add the this date to the data table?

 

obriaincian_0-1676635616857.png

 

 

Thanks

 

 

 

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @obriaincian 

You can add a custom column using the Custom Column dialog box, where the expression to use for the column references the "Filtered Rows2" step, Date Created column first row.

The formula to enter in the dialog box would be:

= #"Filtered Rows2"[Date created]{0}

 

The code in the formula bar would be something like this:

= Table.AddColumn(#"Added Custom", "Date created", each #"Filtered Rows2"[Date created]{0}, type datetime)

Here's a screenshot from a test query I created:

OwenAuger_0-1676636628208.png

Does this work?

Regards,


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

3 REPLIES 3
obriaincian
Resolver I
Resolver I

@OwenAuger thank you for the above, I am having an issue however, when I try to create a custom column the page just stays on the loading phase and the column never gets created.

No problem, and sorry to hear that there seems to be a performance issue when adding this step.

 

One thing you could try:

1. Select the "Filtered Rows2" step

2. Edit the M code in the formula bar by wrapping it in Table.Buffer( ... 😞

= Table.Buffer ( Table.SelectRows(#"Filtered Rows1", let latest = List.Max(#"Filtered Rows1"[Date created]) in each [Date created] = latest) )

3. Then add the "Date created" column as described earlier.

 

The idea her is to buffer the step that contains "Date created". This should prevent the query re-querying SharePoint just to fetch that date.

Does this work any better?

 

Another option would be to modify the steps of your query so that the "Date created" column remains in the table from step "Filtered Rows2" onwards, but you would need to tweak the steps transforming the Excel file. If you want to try that, could you post your entire M code here (if possible)?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
OwenAuger
Super User
Super User

Hi @obriaincian 

You can add a custom column using the Custom Column dialog box, where the expression to use for the column references the "Filtered Rows2" step, Date Created column first row.

The formula to enter in the dialog box would be:

= #"Filtered Rows2"[Date created]{0}

 

The code in the formula bar would be something like this:

= Table.AddColumn(#"Added Custom", "Date created", each #"Filtered Rows2"[Date created]{0}, type datetime)

Here's a screenshot from a test query I created:

OwenAuger_0-1676636628208.png

Does this work?

Regards,


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Kudoed Authors