cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ktt777
Helper IV
Helper IV

Loading data into powerbi

hi , 

 

How can i load data into power bi as text : example  0090015?

the first 3 record in my data loaded , it trim the first 2 zero

 

Here is the link to my file 

 

https://1drv.ms/x/s!ApIDnMK2eKiFgQcBMkuQB3U0lybN?e=uigm9J

 

thanks 

2 ACCEPTED SOLUTIONS

Hi @ktt777 ,

 

I have checked your data source. The original data doesn't contain "00".

v-xuding-msft_0-1595393959635.png

 

There are two ways that can implement it. You could follow my step to have a try.

  • In Model view > choose Whole number and Custom format : 00#####

v-xuding-msft_1-1595394161777.png

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings

 

  • Create a formula using FORMAT()
Column = FORMAT(test[Project (7 digits)],"00#####")

v-xuding-msft_2-1595394329066.png

https://docs.microsoft.com/en-us/dax/format-function-dax

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

lit2018pbi
Resolver II
Resolver II

Hi,

 

You can add a Custom column as 

Leading zeros = Text.PadStart(Number.ToText([Column2]),7,"0")

It should resolve your problem.

 

Thanks

View solution in original post

8 REPLIES 8
lit2018pbi
Resolver II
Resolver II

Hi,

 

You can add a Custom column as 

Leading zeros = Text.PadStart(Number.ToText([Column2]),7,"0")

It should resolve your problem.

 

Thanks

Tahreem24
Super User
Super User

Try to select that column and change it's format to Text.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , and Fortune 500 Companies Analysis
amitchandak
Super User
Super User

@ktt777 , check the data type. It should be text. Change it in Data Transformation mode /edit query mode.



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

when i change to text, it trim the first 2 zeros

@ktt777 , OPen data transformation mode, Right-click on Table. Open Advance editor.

It should have a data type there. Is the the data type is text and it is still removing leading 0 ?



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

yes, the data type is text but the zeros are removed 

Do you know what is the difference in data in cell B5 and B7. 

Data in cell B7 will be kept, only zeros in B5 are removed

 

Thanks.  

Hi @ktt777 ,

 

I have checked your data source. The original data doesn't contain "00".

v-xuding-msft_0-1595393959635.png

 

There are two ways that can implement it. You could follow my step to have a try.

  • In Model view > choose Whole number and Custom format : 00#####

v-xuding-msft_1-1595394161777.png

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings

 

  • Create a formula using FORMAT()
Column = FORMAT(test[Project (7 digits)],"00#####")

v-xuding-msft_2-1595394329066.png

https://docs.microsoft.com/en-us/dax/format-function-dax

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors