Forum Discussion
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.
Please refer to this:
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.
5 Replies
- Migasuke
Memorable Member
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!- AnonymousNot 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- Migasuke
Memorable Member
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.
- V-lianl-msft
Community Support
Please refer to this:
- kakarot13Frequent 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.