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
admin11
Memorable Member
Memorable Member

Amount field unable to use change type to convert to whole number.

Hi All

I have Amount field , when i load by file , no issue , i can change type from text to whole number.. But when i load by sharepoint folder. it will load as text. and i am unable to use change type to convert it to whole number. van some one share with me what should i do ? or can some one sharing with me how to remove the $ sign ? 

admin11_0-1613742494295.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@admin11 , Right click on table name and open advance editor and change the data type of amount like

 

{"Amount", Currency.Type}

 

full code

let
    Source = Csv.Document(File.Contents("C:\Users\Amit.Chandak\Downloads\CRM_TS_10.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}, {"Column12", type text}, {"Column13", type text}, {"Column14", type text}, {"Column15", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"POTENTIALID", type text}, {"Closing Date", type date}, {"Deal Name", type text}, {"Stage", type text}, {"Company Name", type text}, {"Full Name", type text}, {"Amount", Currency.Type}, {"Deal Owner", type text}, {"Main Segment", type text}, {"Sub Segment", type text}, {"Email", type text}, {"Mobile", type text}, {"Department", type text}, {"Title", type text}, {"SBU", type text}})
in
    #"Changed Type1"

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@admin11 , Right click on table name and open advance editor and change the data type of amount like

 

{"Amount", Currency.Type}

 

full code

let
    Source = Csv.Document(File.Contents("C:\Users\Amit.Chandak\Downloads\CRM_TS_10.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}, {"Column12", type text}, {"Column13", type text}, {"Column14", type text}, {"Column15", type text}}),
    #"Removed Top Rows" = Table.Skip(#"Changed Type",1),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"POTENTIALID", type text}, {"Closing Date", type date}, {"Deal Name", type text}, {"Stage", type text}, {"Company Name", type text}, {"Full Name", type text}, {"Amount", Currency.Type}, {"Deal Owner", type text}, {"Main Segment", type text}, {"Sub Segment", type text}, {"Email", type text}, {"Mobile", type text}, {"Department", type text}, {"Title", type text}, {"SBU", type text}})
in
    #"Changed Type1"

@amitchandak By the i have try to replace $ sign with null , it work fine now , thank you for your help.

Paul

@amitchandak 

 

When i try to replace text to Currency.text i get error.

 

Amount at 7 column :-

admin11_0-1613744937459.png

Error msg :-

admin11_1-1613745062205.png

 

 

Below is the detail code :-

 

let
Source = SharePoint.Files("https://isdnholdings.sharepoint.com/sites/FT_CRM/", [ApiVersion = 15]),
#"CRM_TS csv_https://isdnholdings sharepoint com/sites/FT_CRM/Shared Documents/" = Source{[Name="CRM_TS.csv",#"Folder Path"="https://isdnholdings.sharepoint.com/sites/FT_CRM/Shared Documents/"]}[Content],
#"Imported CSV" = Csv.Document(#"CRM_TS csv_https://isdnholdings sharepoint com/sites/FT_CRM/Shared Documents/",[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Changed Type" = Table.TransformColumnTypes(#"Imported CSV",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}, {"Column12", type text}, {"Column13", type text}, {"Column14", type text}, {"Column15", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"CRM_TS :", type text}, {"", type text}, {"_1", type text}, {"_2", type text}, {"_3", type text}, {"_4", type text}, {"_5", type text}, {"_6", type text}, {"_7", type text}, {"_8", type text}, {"_9", type text}, {"_10", type text}, {"_11", type text}, {"_12", type text}, {"_13", type text}}),
#"Promoted Headers1" = Table.PromoteHeaders(#"Changed Type1", [PromoteAllScalars=true])
in
#"Promoted Headers1"

 

@admin11 , I think the data type change needs to happen after the promoted header. In your case it is before

@amitchandak 

Thank you for your advise.

Now  i try to promoted the header , then i go to advance edit to change , see below image :-

admin11_0-1613775687509.png

But i get error msg :-

admin11_1-1613775792515.png

when i click okay i get :-

admin11_2-1613775889792.png

 

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.