Forum Discussion
Create new column with data from other column
basic question.... how i create new column that takes data from several other columns ....
I did created new measure, but it doesnt allow me to relate to any column that is not a measure/DAX ....
Anonymous , You can create in quite a few manners
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
complex example
Last Activity = maxx(filter(Table, [Customer Id]=earlier([Customer Id]) && [Activity ]<earlier([Activity ])),[Activity ])
Last Activity Type = maxx(filter(Table, [Customer Id]=earlier([Customer Id]) && [Activity ]=earlier([Last Activity])),[Activity Type])
2 Replies
- Greg_Deckler
Community Champion
[New Column] = [Column1] + [Column2] - [Column3]
To reference a column in a measure you must wrap it in an aggregation like MIN, MAX, SUM, AVERAGE, etc.
- amitchandak
Super User
Anonymous , You can create in quite a few manners
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
complex example
Last Activity = maxx(filter(Table, [Customer Id]=earlier([Customer Id]) && [Activity ]<earlier([Activity ])),[Activity ])
Last Activity Type = maxx(filter(Table, [Customer Id]=earlier([Customer Id]) && [Activity ]=earlier([Last Activity])),[Activity Type])