Forum Discussion
custom column created in data view not appearing in edit query view
- 10 years ago
If you tell us a little more about the columns you are trying to concatenate then we can help you with the code you need to do this.
What are the names of the columns and what are their data type?
if they are both text then it is pretty straight forward to do this. Just go to the Add Column pane and press Add Custom Column. Then give you column a name and in the Available columns locate the first column you want in your concatenated column and double click it then add a & and find the 2nd column and double click it and select okay.
The final result could look something like this: = [column1] & [Column2]
if you want some kind of delimiter between the 2 columns you can add this like this [column1] & "-" & [Column2]
if any of the values are a number then you need to format this as a text in the formula you can do this with the Number.ToText function (and you need to right it like this - M is case sensitive so number.totext will return an error) - so lets say column1 is a number then the formula will be like this: Number.ToText([column1]) & "-" & [Column2]
I hope this helps you a little... if you need help with M then this page have all the functions and shows examples of how to use them.
I liked the reply but i disagree with logic. In iterative work, every time you will not go to the first part to start a sequential process. whatever we do in the subsequent process should not be waste when you re visit the initial part to incorporate the feed back.
Even in power BI, if i rename a column in data view, the same is applied in power query. and the same should be with my new columns with dax also.
i am sure this will be there in the future power BI.
Just a guess: If DAX was just for Power BI, we wouldn't have calculated columns with DAX in there.
But as it shall be compatible with (old) Excel and SSAS tabular, we have them (yes, there should be a warning sign, that they can only used in DAX unlike the query/M ones).
I would be very happy (for other reasons) if it wasn't a one-way-street, but very much doubt that this will change.