Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
It maybe a simple solution but I am struggling to get my column in Power Query (PowerBI) to accept a number and text format.
Could you please advise on how I can keep both number and text format in my column without an error?
Thank you!
Solved! Go to Solution.
You have to find a step where the function "Table.TransformColumnTypes" is used for that specific column "Proc. Type" for the first time. If in one of the previous steps the type was changed to number, trying to change data type to text later on will not "recover" the data. In the screenshot we cannot see what previous steps were applied so we can just guess why it does not work for you.
Thanks all! It did work
You will have to format the number as text in order to keep both in the same column.
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Thank you, I tried that initially but it still keeps the text as an error
You can do something like the script below. If this does not work for you please post the script that you are using to create the column and then we can help modify it so that it works.
Table.AddColumn(#"Prev Step", "Custom", each if Value.Is(Value.Type([Column1]), type number) then Number.ToText([Column1]) else [Column1], type text)
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
You have to find a step where the function "Table.TransformColumnTypes" is used for that specific column "Proc. Type" for the first time. If in one of the previous steps the type was changed to number, trying to change data type to text later on will not "recover" the data. In the screenshot we cannot see what previous steps were applied so we can just guess why it does not work for you.
User | Count |
---|---|
17 | |
10 | |
9 | |
9 | |
8 |
User | Count |
---|---|
23 | |
17 | |
14 | |
12 | |
11 |