Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |