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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Paulyeo11
Impactful Individual
Impactful Individual

Seek help on load txt file to PBI

Hi All

 

My AR Raw data :-

https://www.dropbox.com/s/vljjghrz4dpehiy/AR_TS_10.txt?dl=0

 

The raw data format as I below  :-

Paulyeo11_0-1603862093015.png

 

After i load into PBI , 3 and 4 column combine with company field . those i mark red color box is having trouble :-

Paulyeo11_1-1603862270220.png

 

 

2 ACCEPTED SOLUTIONS

Hi @Paulyeo11 

You need to change the column numbers on the fixed width import dialog.

csv-fixed-width.png

This query will do the job

 

 

let
    Source = Csv.Document(File.Contents("D:\temp\AR_TS_10.txt"),8,{0, 9, 68,72,99, 119, 126, 161},null,1252)
in
    Source

 

 

Change the file location.  I've loaded it form hard disk, assume you are doing the same?

Phil 


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

Hi @Paulyeo11 

Here's the PBIX file

All I did was open the text file in VS Code and count the column numbers so I knew what numbers to insert in the import dialog.

The numbers {0, 9, 68, 72, 99, 119, 126, 161} indicate the column numbers where PBI creates a new column.

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Paulyeo11 , Try delimiter as Tab \t and check-in place of fixed-width while loading. 

Hi Amit

I cannot find it. Can you pls share how to do it ? ( some time back i have the same issue , some one is able to do it  , i ask him how he do it , he no reply my post )

 

Paulyeo11_0-1603864703158.png

 

Hi @Paulyeo11 

You need to change the column numbers on the fixed width import dialog.

csv-fixed-width.png

This query will do the job

 

 

let
    Source = Csv.Document(File.Contents("D:\temp\AR_TS_10.txt"),8,{0, 9, 68,72,99, 119, 126, 161},null,1252)
in
    Source

 

 

Change the file location.  I've loaded it form hard disk, assume you are doing the same?

Phil 


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi Philip

Yes these are the script i need to learn , can you pls share with me how you do it ?

may be you can share the PBI file with me

Paul

Hi @Paulyeo11 

Here's the PBIX file

All I did was open the text file in VS Code and count the column numbers so I knew what numbers to insert in the import dialog.

The numbers {0, 9, 68, 72, 99, 119, 126, 161} indicate the column numbers where PBI creates a new column.

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi Philip

Thank you so much for the file attachment , and now i finally understand how does it work , and i don't need to convert all my Text file to CSV file. i owe you a beer.

Paul Yeo

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.