Forum Discussion
help with DAX
- 6 years ago
Gareth_Hunt , Create a new column like
new column =
var _salesm = maxx(filter(Table,table[Order] =earlier([Invoice])),[Salesman])
return
if([TYPE] ="IN",[Salesman],[_salesm])
Gareth_Hunt , Create a new column like
new column =
var _salesm = maxx(filter(Table,table[Order] =earlier([Invoice])),[Salesman])
return
if([TYPE] ="IN",[Salesman],[_salesm])
- Gareth_Hunt6 years ago
Helper II
Hi Sorry -I dont understand your expression, this is as far as I have got - I have no table reference??
thanks for your help though
- ibarrau6 years ago
Super User
Hi, that is the "transform data" view. That query editor is for power query language transformations. Amit has sent you a DAX formula as you have asked. Check this doc that will help you build Amit's solution to validate it.
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-calculated-columns
Regards,
- Gareth_Hunt6 years ago
Helper II
Hi Amitchandak,
Ok so I have created a new column as prescribed and im looking to apply your example and its works well thank you guys
NB removed the [] from around _salesm as it was erroring out in case anyone else looks at this in the future
"new column =
var _salesm = maxx(filter(Table,table[Order] =earlier([Invoice])),[Salesman])
return
if([TYPE] ="IN",[Salesman],_salesm)"