Forum Discussion
Anonymous
4 years agoNot applicable
Conditional Formatting by comparing Two State Columns
Hi Team, I have four colums Source Id and its State and Target ID and its State. I would like to achieve rollup of targetID state and then color code the source Id (Title) to either Red or Green...
- 4 years ago
Hi Anonymous ,
Try to create a measure and set conditional formatting like so:
Measure = VAR SourceStates_ = VALUES ( 'Stage State'[Source State] ) VAR CurSourceState_ = MAX ( Source[Source State] ) VAR TargetStates_ = CALCULATETABLE ( VALUES ( 'Stage State'[Target State] ), 'Stage State'[Source State] = CurSourceState_ ) VAR CurTargetStates_ = CALCULATETABLE ( VALUES ( Source[Target State] ), ALLEXCEPT ( Source, Source[Source ID], Source[Source State] ) ) VAR ExceptTargetStatesCount_ = COUNTROWS ( EXCEPT ( CurTargetStates_, TargetStates_ ) ) RETURN IF ( CurSourceState_ IN SourceStates_ && ExceptTargetStatesCount_ = 0, "Green", "Red" )And Matrix visual can't set conditional formatting on fields on Rows or Columns.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Example:
| Source ID | Source State | Target ID | Target State |
| 219203(Red) | New | 249831 | Blocked |
| 247611 | Ready | ||
| 295531(Green) | Phase 3 - Prototype | 569794 | Done |
| 295531 | 328384 | Removed | |
| 295531 | 328382 | Done | |
| 295531 | 812856 | Done | |
| 295531 | 519393 | Dev | |
| 308468(Red) | Phase 3 - Prototype | 890933 | Ready |
| 872697 | New | ||
| 335460(Red) | Phase 3 - Prototype | 291654 | Done |
| 336072 | Removed | ||
| 350896 | Removed | ||
| 863825 | New | ||
| 868718 | New | ||
| 860056 | New |