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

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

Reply
admin11
Memorable Member
Memorable Member

How to add one more field Date into my PBI file ?

Hi All

I have a PBI file , in the past it does not have Date field.

Now i need to add the Date field.

I have try to load the file with out date , the script as below :-

 

let

    Source = SharePoint.Files("https://isdnholdings.sharepoint.com/sites/FT_AR/", [ApiVersion = 15]),

    #"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "AR_TS_O.csv")),

    #"AR_TS_O csv_https://isdnholdings sharepoint com/sites/FT_AR/Shared Documents/" = #"Filtered Rows"{[Name="AR_TS_O.csv",#"Folder Path"="https://isdnholdings.sharepoint.com/sites/FT_AR/Shared Documents/"]}[Content],

    #"Imported CSV" = Csv.Document(#"AR_TS_O csv_https://isdnholdings sharepoint com/sites/FT_AR/Shared Documents/",[Delimiter=",", Columns=12, Encoding=1252, QuoteStyle=QuoteStyle.None]),

    #"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV", [PromoteAllScalars=true]),

    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Customer/Vendor Code", type text}, {"Customer/Vendor Name", type text}, {"AgeingDate", Int64.Type}, {"A/R amount include GST in LC", type number}, {"AR Invoice Date", type date}, {"AR Invoice Number", Int64.Type}, {"SalesPerson", type text}, {"SlpName", type text}, {"Industry_Description", type text}, {"CustClass", Int64.Type}, {"Payment Terms Code", type text}, {"CreditLine", Int64.Type}})

in

    #"Changed Type"

 

Since i need to add below Date filed to above script :-

, {"Date", type date}

 

 

admin11_0-1615452141504.png

I get error msg below :-

admin11_0-1615452221701.png

 

Hope some one can share with me where go wrong ?

 

Paul

 

 

 

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

In addition to the change suggested by you, in the #"Imported CSV" step, change 12 to 13.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

Thank you very much for sharing , i think you high light the most important point , that must be the reasons , after i have add the Date field it still cannot work. now i will try to change 12 to 13 , see it work ? 

 

admin11_1-1615870248212.png

 

Anonymous
Not applicable

HI @admin11,

Did Ashish_Mathur 's suggestion help with your scenario? If that is the case, you can good or accept his suggestion to help others who faced similar requirements.

If the above not help, please share more detailed information to help us clarify and test your situation.

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @admin11,

In fact, power query steps will cache the data structure into query step and not auto-sync. If you change your data source structure, you need to manually fix them in the query steps to fix not match fields.

Have you refreshed your data table to update for the last version and review each step to confirm if the date field exists in them?
Regards,
Xiaoxin Sheng

@Anonymous 

Thank you for sharing .

Do you mean i need to click on below button " Clear Cache " ? before i can edit the M Code ?

admin11_0-1615870108464.png

 

Anonymous
Not applicable

HI @admin11,

I mean you can click on the refresh button on the query editor side to refresh the previewed query table records.
Normally, it shows the preview of your query steps operations with the data snapshot from your data source, and they not auto-updated. (sometimes you can find the query table notice these data has stored XXXX day old without update)

Regards,

Xiaoxin Sheng

@Anonymous 

Thank you for your sharing.

Paul

vanessafvg
Super User
Super User

I think you need to explain a bit deeper.  What date field are you trying to add the current date?  Is it a field you want, or a table?  Where is the source of the date field coming from your question does not provide enough information.  what i can see is that its ask where is the date coming from?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg 

Thank you very much for sharing.

My existing raw data file is below , notice that last column no Date field :-

admin11_1-1615453606194.png

Below is my new raw data file.  The last column is Date field , which i just added . This field will let me me know when this raw data is generated. 

admin11_0-1615453571441.png

Hope you are clear now.

 

Paul Yeo

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.