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.
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"
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 |
---|---|
9 | |
9 | |
7 | |
6 | |
6 |