# 7.8 ₹, commas आणि text मधले numbers

Source: https://ravindrabagale.com/mr/powerbi/ch07-data-cleaning-a-z-in-power-query/7-8-numbers-stored-as-text-symbol-and-commas.html
Language: mr (Marathi with English technical terms)

Currency symbols असलेली value अनेकदा Text म्हणून येते. खाली conversion आधी व नंतरचा data आहे.

 | Order ID
 | Amount
 | Delivery Fee

 | BLK-30001
 | ₹1,250
 | ₹25

 | BLK-30002
 | ₹ 86.50
 | Free

 | BLK-30003
 | 2,40,000
 | ₹0

 | BLK-30004
 | Rs. 499
 | ₹30

 | Order ID
 | Amount
 | Delivery Fee

 | BLK-30001
 | 1250.00
 | 25

 | BLK-30002
 | 86.50
 | 0

 | BLK-30003
 | 240000.00
 | 0

 | BLK-30004
 | 499.00
 | 30

Amount आणि Delivery Fee मधून Replace Values वापरून ₹ काढा.

Rs., thousands commas आणि अनावश्यक spaces काढा.

Delivery Fee मधलं Free खरोखर free असेल तर 0 करा.

Fixed Decimal Number type द्या.

Quality bar तपासा. उरलेले errors वेगळ्या duplicate query मध्ये Keep Errors करून पाहा.

Numbers = Table.TransformColumns(Source, {
    {"Amount", each Number.From(Text.Remove(Text.Replace(_, "Rs.", ""), {"₹", ",", " "})), Currency.Type},
    {"Delivery Fee", each if _ = "Free" then 0 else Number.From(Text.Remove(_, {"₹", ",", " "})), Currency.Type}
})

2,40,000 च्या commas काढल्यावर 240000 मिळतं. Text.Remove ने अनेक ठरलेली characters एकदम काढता येतात.

Practice

Nashik College Road च्या test sheet मधले ₹ 1,099, ₹99.00 आणि N/A clean करा. N/A → null; बाकी Fixed Decimal.

रवींद्र बागले यांची tip

Text numbers 1000, 125, 20 अशा अक्षरक्रमाने sort होतात आणि Sum ऐवजी Count दिसू शकतो. पण 86,50 मध्ये comma decimal separator असेल तर तो काढणं चुकीचं आहे. Source format आधी पाहा.
