Forum Discussion
hgzelaya
Helper I
7 years agoHelp!! Previous month status vs next month
Hello everyone, i´m having an issue with the following excercise. Client ID Status Month CONDITION 250 UNAVAILABLE abr.-19 FALSE 250 UNAVAILABLE may.-19 FALSE 250 OK jun...
- 7 years ago
Hello hgzelaya
If the Month column is an actual date I was able to get it to work with this.
Condition = VAR ClientID = 'YourTable'[Client ID] VAR PMStatus = CALCULATE ( MAX ( 'YourTable'[Status] ), ALL ( 'YourTable' ), 'YourTable'[Client ID] = ClientID, DATEADD ( 'YourTable'[Month], -1, MONTH ) ) VAR CMStatus = 'YourTable'[Status] RETURN NOT ISBLANK ( PMStatus ) && NOT CONTAINSSTRING ( PMStatus, "OK" ) && CONTAINSSTRING ( CMStatus, "OK" )
jdbuchanan71
Super User
7 years agoHello hgzelaya
If the Month column is an actual date I was able to get it to work with this.
Condition =
VAR ClientID = 'YourTable'[Client ID]
VAR PMStatus =
CALCULATE (
MAX ( 'YourTable'[Status] ),
ALL ( 'YourTable' ),
'YourTable'[Client ID] = ClientID,
DATEADD ( 'YourTable'[Month], -1, MONTH )
)
VAR CMStatus = 'YourTable'[Status]
RETURN
NOT ISBLANK ( PMStatus )
&& NOT CONTAINSSTRING ( PMStatus, "OK" )
&& CONTAINSSTRING ( CMStatus, "OK" )
- hgzelaya7 years ago
Helper I
i don´t actually know what you really did right there but, it actually worked! I appreciate it!