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
Anonymous
Not applicable

Leading zeros disappear while exporting to csv

Hi all,

I have a report on Power BI with column varchar from source cotaining numbers. After exporting the report to csv the leading zeros are being considered as number by Excel and getting removed. Same is happening on Report buider tool. 
Eg- '000345' after csv export 345

 

Is there any word around for this.

 TIA.

2 ACCEPTED SOLUTIONS
V-lianl-msft
Community Support
Community Support

kakarot13
Frequent Visitor

Hi @Anonymous ,

 

I had the same issue. Unfortunately it's not a PowerBI service, Desktop or Report builder issue. It's actually the doing of Excel Application. Excel is converting the values into integer by default. I opened my csv file in Notepad and the data did look good with the leading zeros. 

View solution in original post

5 REPLIES 5
kakarot13
Frequent Visitor

Hi @Anonymous ,

 

I had the same issue. Unfortunately it's not a PowerBI service, Desktop or Report builder issue. It's actually the doing of Excel Application. Excel is converting the values into integer by default. I opened my csv file in Notepad and the data did look good with the leading zeros. 

V-lianl-msft
Community Support
Community Support

Migasuke
Super User
Super User

Hi @Anonymous ,

Open the CSV in a different order:
1. Open Excel.
2. Click, Open the file
3. Open the CSV you want to open.

In this order you will be able to see all values in the field, including the zeros at the beginning.

If this helps, please mark it as a solution!



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Anonymous
Not applicable

Thanks for your insights. 
Doing this will make the header as a new row with comma delimiter and isn't very efficient way to access csv for my client. My client explicitly wants a csv as attachment from power Bi platform. When he/she opens the attachment they should be good from there without having to do other stuff as per their requirement.


Thanks

Hi @Anonymous ,

unfortunatelly opening the csv the way you want is issue of Excel itself. I know it was not possible to open csv by default without changing format. Unless they developed this featuree recently, you need to use import dialogue.



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

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.