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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to add timestamp for data load in Advance Editor in Power BI

Hello All,

 

We have a small excel that contains two columns. Emp Name & Compliane %.

EmployeeCompliance %
Steve80%
Mathew75%
John65%

 

While loading this excel into Power BI, we need to add timestamp as MMM-YYYY (Current Month-Year). We tried but getting multiple issues. Below is the code we use in Advance Editor:

 

let
    Source = Excel.Workbook(Web.Contents("https://mysharepoint.com/personal/prus_com/Documents/Employee.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Employee", type text}, {"Compliance %", type number}})
in
    #"Changed Type"

 

 

How to add timestamp while loading data into all the rows with Excel data.

Thanks,

PBI V2

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can add a custom column in Power Query Editor to get it, please update the applied codes of your Advanced Editor as below:

let
    Source = Excel.Workbook(Web.Contents("https://mysharepoint.com/personal/prus_com/Documents/Employee.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Employee", type text}, {"Compliance %", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "timestamp", each DateTime.ToText(DateTime.LocalNow(),"MMM-yyyy"))
   in
    #"Added Custom"

vyiruanmsft_0-1694158928162.png

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

You can add a custom column in Power Query Editor to get it, please update the applied codes of your Advanced Editor as below:

let
    Source = Excel.Workbook(Web.Contents("https://mysharepoint.com/personal/prus_com/Documents/Employee.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Employee", type text}, {"Compliance %", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "timestamp", each DateTime.ToText(DateTime.LocalNow(),"MMM-yyyy"))
   in
    #"Added Custom"

vyiruanmsft_0-1694158928162.png

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors