Forum Discussion
custom column created in data view not appearing in edit query view
i created a custom column with DAX. This is to combine 2 columns to create a new column. My second table also having these two columns and there also i created a similar custom column. now i combine these two tables through a bridge of this unique column.
But the custom column is not appearing in edit query window where i am supposed to delete other columns ( and remove duplicates of combination of the two fields which i concatenated so that i will be having a unique field column).
so what is the solution?
if i can have composite key relation in model view, i can avoid this work. But modeling view is not allowing me to select two fields to give relation.
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.
10 Replies
- sdjensen
Solution Sage
You should try to add you new column in the query editor instead of using DAX. I think when you add a column using dax this happens after the query editor, hence you cannot see this column in the query editor.
- SatyaVaitla
Advocate II
but in query editor, there is no contextual help to write the formula during addition of new column. Also my concatenate function is not working here
- AnonymousNot applicable
Can u please explain your requirement clearly.
Let me know...
- AnonymousNot applicable
Hi Satya,
Whatever u created in DAX its not apear in Query Editor Screen. Sorry :smileysad:
- AnonymousNot applicable
Anonymous if you create some columns/measures in DAX, then make a change in the query editor and apply it, will the columns/measures in DAX still be there?