March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello all,
I ran into a new problem for myself, I'm a bit new to Power BI. I created a custom column in the past by taking a two letter abbrevaition in a column and creating a new column with the full name of a city.
Now I have new custom column I'm trying to create. One of the columns I have is a "whole number" type, then I'm trying to create a custom column that will convert that number into a message that will be text.
Example: New custom column name is "Error Message"
if [error code_d] = "60012" then "The installation has timed out due to no user interaction".
else if [error code_d] = "60013 then "Source File not found."
else [error code_d]
You get the idea. So the column name [error code_d] is currently a "whole number" type, but the new column that I created (Error Message) is only carrying over the numbers and not the message. Do I need to change the type of the [error code_d] to text first? When I do that, I noticed it adds a decimal point.
Is there an easier way to get to what I need?
Solved! Go to Solution.
How are you creating the new column? You can use the standard Conditional Column UI to get those results. See:
Proud to be a Super User!
How are you creating the new column? You can use the standard Conditional Column UI to get those results. See:
Proud to be a Super User!
Hi, thanks for that.
I was just clicking "Custom Column" and writing some basic code. I quickly put something together to show you.
1.The "Return_Code_d" type is listed as "whole number"
2. New Column [Error Code] is type "Any Data Type" from what I read as it being labeled as "ABC 123"
Example:
So when I went to take a snap shot of what I just did, it just started working. I swear I did the same thing from before and all it did was bring the return error codes number to the new column. Maybe I did something wrong.
Having said that and it seems to be working at the moment. I am glad you took the time to show my "Conditional Columns". I never new you could set the "data typs" that way.
Thank you both.
what is the data type of the new column?
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |