Forum Discussion
How to make select a format for column containing numbers or text?
- 1 year ago
You need to make sure you're making the type conversion BEFORE any other conversions take place. It looks like you probably have 'Automatically detect data types' enabled and Power Query has put a conversion step in for you at the start of the query steps just after the source is imported.
Go to the top of your query steps and see if there's a Changed Types step already there. If yes, then select that step, change the type of your column to Text and, when prompted, choose to replace the step, rather than add a new one.
Pete
- 1 year ago
Perfect. Glad that worked for you.
As an aside: Do NOT use Type Any in Power Query. You should always change your columns to explicit data types. It doesn't have to be done at the first step that we're talking about, but you should always ensure that all of your columns have an explicit data type by the end of the query to avoid causing yourself problems when you apply the query to the data model.
Pete
I doesn't want to replace value, I need to keep the data as it is even if number or text.
What I meen is I didn't want to make calculations for number cells, I want power BI read the number as a text.
But when I change the column data type to Text, still give the same error in cells that have text "We couldn't convert to number".
You need to make sure you're making the type conversion BEFORE any other conversions take place. It looks like you probably have 'Automatically detect data types' enabled and Power Query has put a conversion step in for you at the start of the query steps just after the source is imported.
Go to the top of your query steps and see if there's a Changed Types step already there. If yes, then select that step, change the type of your column to Text and, when prompted, choose to replace the step, rather than add a new one.
Pete
- Moh_Ashraf1 year agoFrequent Visitor
Yes, thats right,
I found another step for automatic change data type at first,
I found the column that I have a combined text and value is "int64. type" but I changed it to "Type any"
Thank you for support
- BA_Pete1 year agoSuper User
Perfect. Glad that worked for you.
As an aside: Do NOT use Type Any in Power Query. You should always change your columns to explicit data types. It doesn't have to be done at the first step that we're talking about, but you should always ensure that all of your columns have an explicit data type by the end of the query to avoid causing yourself problems when you apply the query to the data model.
Pete