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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.