Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
Values is mixed up with number and text.
Need only number so output will be:
16571
10000
0
0
0
0
0
0
41429
0
Solved! Go to Solution.
Hello @jeongkim,
Thanks for your follow-up and clarification regarding the "金額" column.
Based on your updated query, you can modify your code to extract only the numeric values from the "金額" column like this:
let
// Existing steps
#"Renamed Columns2" = Table.RenameColumns(#"Expanded Work Order PDF - bottom", {
{"Work Order PDF - top b.派工單號", "派工單號"},
{"Work Order PDF - top b.PO NO", "PO NO"},
{"Work Order PDF - middle.標的物編號", "標的物編號"},
{"Work Order PDF - middle.標的物名稱", "標的物名稱"},
{"Work Order PDF - middle.監工人員", "監工人員"},
{"Work Order PDF - middle.備 註", "備 註"},
{"Work Order PDF - bottom.派工工程項目", "派工工程項目"},
{"Work Order PDF - bottom.4G or 5G", "4G or 5G"},
{"Work Order PDF - bottom.安裝型態", "安裝型態"},
{"Work Order PDF - bottom.金額", "金額"},
{"Work Order PDF - bottom.數量", "數量"}
}),
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns2", {
"Source Name", "通知日期", "派工目的", "派工單號", "PO NO",
"標的物編號", "標的物名稱", "監工人員", "備 註", "派工工程項目",
"4G or 5G", "安裝型態", "金額", "數量", "Date created"
}),
// New step: Remove non-numeric characters from 金額 column
#"RemoveNonNumericFrom金額" = Table.TransformColumns(#"Reordered Columns", {
{"金額", each Text.Select(Text.From(_), {"0".."9"}), type text}
}),
// New step: Convert cleaned 金額 column to number
#"金額ToNumber" = Table.TransformColumnTypes(#"RemoveNonNumericFrom金額", {
{"金額", Int64.Type}
})
in
#"金額ToNumber"
This ensures that if your "金額" column contains mixed text and numbers (e.g., "金額=NTD5000"), it will properly extract only the numbers (e.g., 5000).
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi @jeongkim,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @jeongkim,
May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi, @jeongkim
Thanks for the reply from bhanu_gautam. Try this in Power Query.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKs4sSS3Wfdbd9nLmkvinPdN1Dc1MzQ2VYnWilQwNgADMwk+aGJoYWSLxLSH6YgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
RemoveNonNumeric = Table.TransformColumns(Source, {"Column1", each Text.Select(_, {"0".."9"}), type text}),
ChangeType = Table.TransformColumnTypes(RemoveNonNumeric,{{"Column1", Int64.Type}})
in
ChangeType
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi,
Can you re-write the code pls?
#"Renamed Columns2" = Table.RenameColumns(#"Expanded Work Order PDF - bottom",{{"Work Order PDF - top b.派工單號", "派工單號"}, {"Work Order PDF - top b.PO NO", "PO NO"}, {"Work Order PDF - middle.標的物編號", "標的物編號"}, {"Work Order PDF - middle.標的物名稱", "標的物名稱"}, {"Work Order PDF - middle.監工人員", "監工人員"}, {"Work Order PDF - middle.備 註", "備 註"}, {"Work Order PDF - bottom.派工工程項目", "派工工程項目"}, {"Work Order PDF - bottom.4G or 5G", "4G or 5G"}, {"Work Order PDF - bottom.安裝型態", "安裝型態"}, {"Work Order PDF - bottom.金額", "金額"}, {"Work Order PDF - bottom.數量", "數量"}}),
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns2",{"Source Name", "通知日期", "派工目的", "派工單號", "PO NO", "標的物編號", "標的物名稱", "監工人員", "備 註", "派工工程項目", "4G or 5G", "安裝型態", "金額", "數量", "Date created"})
in
#"Reordered Columns"
"金額" is the column related.
Hello @jeongkim,
Thanks for your follow-up and clarification regarding the "金額" column.
Based on your updated query, you can modify your code to extract only the numeric values from the "金額" column like this:
let
// Existing steps
#"Renamed Columns2" = Table.RenameColumns(#"Expanded Work Order PDF - bottom", {
{"Work Order PDF - top b.派工單號", "派工單號"},
{"Work Order PDF - top b.PO NO", "PO NO"},
{"Work Order PDF - middle.標的物編號", "標的物編號"},
{"Work Order PDF - middle.標的物名稱", "標的物名稱"},
{"Work Order PDF - middle.監工人員", "監工人員"},
{"Work Order PDF - middle.備 註", "備 註"},
{"Work Order PDF - bottom.派工工程項目", "派工工程項目"},
{"Work Order PDF - bottom.4G or 5G", "4G or 5G"},
{"Work Order PDF - bottom.安裝型態", "安裝型態"},
{"Work Order PDF - bottom.金額", "金額"},
{"Work Order PDF - bottom.數量", "數量"}
}),
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns2", {
"Source Name", "通知日期", "派工目的", "派工單號", "PO NO",
"標的物編號", "標的物名稱", "監工人員", "備 註", "派工工程項目",
"4G or 5G", "安裝型態", "金額", "數量", "Date created"
}),
// New step: Remove non-numeric characters from 金額 column
#"RemoveNonNumericFrom金額" = Table.TransformColumns(#"Reordered Columns", {
{"金額", each Text.Select(Text.From(_), {"0".."9"}), type text}
}),
// New step: Convert cleaned 金額 column to number
#"金額ToNumber" = Table.TransformColumnTypes(#"RemoveNonNumericFrom金額", {
{"金額", Int64.Type}
})
in
#"金額ToNumber"
This ensures that if your "金額" column contains mixed text and numbers (e.g., "金額=NTD5000"), it will properly extract only the numbers (e.g., 5000).
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
@jeongkim Add a new custom column by going to the "Add Column" tab and selecting "Custom Column".
In the Custom Column formula box, enter the following formula to extract only the numeric values:
Proud to be a Super User! |
|
Hi,
Code doesn't seem to correct,, should I put 'try' as well?
If I remove 'try' also not working. shoud I put all number one by one?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
62 | |
46 | |
45 |