March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.-19 | TRUE |
250 | OK | jul.-19 | FALSE |
250 | WAITING | ago.-19 | FALSE |
250 | OK complete | sep.-19 | TRUE |
260 | OK | abr.-19 | FALSE |
260 | OK | may.-19 | FALSE |
260 | OK | jun.-19 | FALSE |
260 | UNAVAILABLE | jul.-19 | FALSE |
260 | UNAVAILABLE | ago.-19 | FALSE |
260 | OK received | sep.-19 | TRUE |
270 | OK | abr.-19 | FALSE |
270 | OK | may.-19 | FALSE |
270 | PENDING | jun.-19 | FALSE |
270 | OK done | jul.-19 | TRUE |
270 | OK | ago.-19 | FALSE |
270 | OK | sep.-19 | FALSE |
I want a calculated column with a true/false statement in which works like this:
if previous month status is anything that doesn´t contains the word "OK" in it AND "actual month contains the word "ok"="TRUE", other than this, "FALSE".
I desire the same results shown in the table above.
This is the link for the data:
https://docs.google.com/spreadsheets/d/1L1rdcxBVGyr60FBRep0XAaeVOYNXX4a35uWNnjkK-Q4/edit?usp=sharing
Thanks for the help in advance!
Solved! Go to Solution.
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" )
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" )
i don´t actually know what you really did right there but, it actually worked! I appreciate it!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |