Forum Discussion
unkCandyd
3 years agoFrequent Visitor
Converting SQL to DAX function lag by partition
Hello Community, I would like to know if possible to convert this sql query to dax query. here is the query: SELECT * , Lag(User, 1,'') OVER( PARTITION BY id ORDER BY Date ASC) AS UserT...
- 3 years ago
UserTarget = MAXX( TOPN( 1, FILTER( TBL, TBL[id] = EARLIER( TBL[id] ) && TBL[date] > EARLIER( TBL[date] ) ), TBL[date], ASC ), TBL[user] )
CNENFRNL
Community Champion
3 years agoUserTarget =
MAXX(
TOPN(
1,
FILTER(
TBL,
TBL[id] = EARLIER( TBL[id] )
&& TBL[date] > EARLIER( TBL[date] )
),
TBL[date], ASC
),
TBL[user]
)