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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
maasool
Helper I
Helper I

Few Table's inside a column, with a majority of numbers

Hello!

I'd like to change the data type of a column to whole number, but it is not possible, because there are few "Table" values inside a column. How to solve this?

 

maasool_0-1654843158058.png


Thanks
Sander

 

1 ACCEPTED SOLUTION

Insert this statement and then change the column type. Replace #"Added Custom" with your previous step name

= Table.ReplaceValue(#"Added Custom",each [InvoiceNr],each if Value.Is([InvoiceNr],type table) then Table.FirstValue([InvoiceNr]) else [InvoiceNr],Replacer.ReplaceValue,{"InvoiceNr"})

 See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyVorViVaCUmbmFmDa1FQpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Invoice = _t]),
    #"Added Custom" = Table.AddColumn(Source, "InvoiceNr", each if [Invoice]="678" then #table({"Col"},{{"897"}}) else [Invoice]),
    Custom1 = Table.ReplaceValue(#"Added Custom",each [InvoiceNr],each if Value.Is([InvoiceNr],type table) then Table.FirstValue([InvoiceNr]) else [InvoiceNr],Replacer.ReplaceValue,{"InvoiceNr"}),
    #"Changed Type" = Table.TransformColumnTypes(Custom1,{{"InvoiceNr", Int64.Type}})
in
    #"Changed Type"

 

View solution in original post

3 REPLIES 3
maasool
Helper I
Helper I

It contains numbers: 

maasool_0-1654846660232.png

 

 

Insert this statement and then change the column type. Replace #"Added Custom" with your previous step name

= Table.ReplaceValue(#"Added Custom",each [InvoiceNr],each if Value.Is([InvoiceNr],type table) then Table.FirstValue([InvoiceNr]) else [InvoiceNr],Replacer.ReplaceValue,{"InvoiceNr"})

 See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyVorViVaCUmbmFmDa1FQpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Invoice = _t]),
    #"Added Custom" = Table.AddColumn(Source, "InvoiceNr", each if [Invoice]="678" then #table({"Col"},{{"897"}}) else [Invoice]),
    Custom1 = Table.ReplaceValue(#"Added Custom",each [InvoiceNr],each if Value.Is([InvoiceNr],type table) then Table.FirstValue([InvoiceNr]) else [InvoiceNr],Replacer.ReplaceValue,{"InvoiceNr"}),
    #"Changed Type" = Table.TransformColumnTypes(Custom1,{{"InvoiceNr", Int64.Type}})
in
    #"Changed Type"

 

Vijay_A_Verma
Super User
Super User

Can you click on one of the tables and post the screenshot here to see what is contained in those tables?

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors