Forum Discussion
alexei7
7 years agoContinued Contributor
DAX help
Hi guys, I'm trying to create a DAX measure and hoping someone can help. As a sample of some dummy date, my data is structured like this: ReportDate ProductCode Store Status Concat...
- 7 years ago
Hi alexei7,
That case, please add a [Rank] column first.
Rank = RANKX ( Products, Products[ReportDate],, ASC, DENSE )
Then, modify the formula in original post as below:
Column1 = VAR previousstatus = LOOKUPVALUE ( Products[Status], Products[ProductCode], Products[ProductCode], Products[Store], Products[Store], Products[Rank], Products[Rank] - 1 ) RETURN IF ( previousstatus = BLANK () || previousstatus = "Not Live", "New", BLANK () )Best regards,
Yuliana Gu
v-yulgu-msft
7 years agoMicrosoft Employee
Hi alexei7,
That case, please add a [Rank] column first.
Rank = RANKX ( Products, Products[ReportDate],, ASC, DENSE )
Then, modify the formula in original post as below:
Column1 =
VAR previousstatus =
LOOKUPVALUE (
Products[Status],
Products[ProductCode], Products[ProductCode],
Products[Store], Products[Store],
Products[Rank], Products[Rank] - 1
)
RETURN
IF ( previousstatus = BLANK () || previousstatus = "Not Live", "New", BLANK () )
Best regards,
Yuliana Gu
alexei7
7 years agoContinued Contributor
I haven't tested this as the user changed requirements a little so I ended up solving this a different way.
Cheers for looking into it though.