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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
lusine
New Member

CSV import - How to preserve "Date created" column in the report

Hi,

 

I am creating report that is based on cumulative data from multiple CSV files. Since each of those CSV files are snapshots and they don't have date column it's very important for me to preserve "Date created" (date when file was created), of each file in my cumultive report.

 

Initially, when I upload all CSV files I get following columns: Content (Binary), Name(file name), Date created (date when file was created), Attributes, etc...

 

How do I preserve "Date created" (date when file was created) column? Whenever I expend Binary, "Date created" is lost.


Would appriciate your help.

 

Thank you

1 ACCEPTED SOLUTION

Hi lusine,

 

Based on your description, you are using get data from folder, and you want to add a created date column to each table, right?

 

First click Binary, then add a step using M code like below:

#"Add Column" = Table.AddColumn( #"Changed Type", "Created Date", each Source{[#"Folder Path"="C:\Users\v-yuta\Desktop\Test\",Name="Test.csv"]}[Date created])

2.png3.PNG4.PNG

 

Regards,

Jimmy Tao

 

View solution in original post

3 REPLIES 3
Rfranca
Resolver IV
Resolver IV

Csv.Document

Hi lusine,

 

Based on your description, you are using get data from folder, and you want to add a created date column to each table, right?

 

First click Binary, then add a step using M code like below:

#"Add Column" = Table.AddColumn( #"Changed Type", "Created Date", each Source{[#"Folder Path"="C:\Users\v-yuta\Desktop\Test\",Name="Test.csv"]}[Date created])

2.png3.PNG4.PNG

 

Regards,

Jimmy Tao

 

Hello Jimmy, 

 

I also have the data source linked to a folder, but the code did not work for me. I have two files currently in the folder with different created dates. Is it possible to have an additional date created column in each of the table? I was thinking of appending the two tables once I have the date to distinguish the two tables. Thanks. 

 

Capture.JPG

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.