Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I am handling a column , it has majorly text values but occasinally some number values that are similar to 1234.4567, 1234.5678 or 3222.7869 type numbers . ( pls note all of these numbers has four whole digits and 4 decimals) . All these numbers need to be mappe to a single name say X .
I am using if Value.Is([Column], Number.Type) then "X" else "P". but no luck so far 😞
can somone help pls.
Hi @avininpowerbi ,
How about this:
Here the code for the logic in the custom column:
try if Value.Is (Number.FromText([Column]), Decimal.Type) then "X" else [Column] otherwise [Column]
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! |
#proudtobeasuperuser |
Hi Tom,
I did try , its threw all errors ! even the normal text has turned into errors.
Any idea ?
Hi @avininpowerbi,
Could you provide a screenshot of the data as well as of the code for the custom column?
thanks 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! |
#proudtobeasuperuser |
Thanks for your help ! since I had no luck extracting the numbers, I used Replace Value ( .00 as the string) with XYZ. Then after, I added a conditional column and used Text.contains . Thats it.
Hi @avininpowerbi - you need to try converting the Text to number to find value, and include otherwise for text values. Like this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSkxKVorViVaqqKwC04ZGxiZ6pmbmFkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Text = _t]),
#"Added Custom" = Table.AddColumn(Source, "Add Test", each try Value.Is( Number.From( [Text] ), Number.Type ) otherwise false)
in
#"Added Custom"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.