Forum Discussion
Conditional Column where Matches Found across multiple columns and tables define the condition
- Anonymous5 years ago
Hi ihartdata
I build a calculated column to add OrgType in Feedback Table and use Conditional Formatting in table visual to show values in Partner Table in Green.
OrgType column:
OrgType = VAR _FBOrgName = Feedback[Organization Name] IN UNION ( VALUES ( Partner[PartnerName] ), VALUES ( Partner[PartnerFriendlyName] ) ) VAR _FBOrgID = Feedback[OrgID] IN VALUES ( Partner[OrgID] ) VAR _FBPartnerID = Feedback[PartnerID] IN UNION ( VALUES ( Partner[PartnerID] ), VALUES ( Partner[PartnerParentID] ) ) VAR _Condition = _FBOrgName || _FBOrgID || _FBPartnerID RETURN IF ( _Condition = TRUE (), "Partner", "Customer" )Build color measure to add in conditional formatting.
Color_OrgName = VAR _FBOrgName = MAX(Feedback[Organization Name]) IN UNION ( VALUES ( Partner[PartnerName] ), VALUES ( Partner[PartnerFriendlyName] ) ) RETURN IF ( _FBOrgName = TRUE (), 1, 0 )Color_OrgID = VAR _FBOrgID = MAX(Feedback[OrgID]) IN VALUES ( Partner[OrgID] ) RETURN IF ( _FBOrgID = TRUE (), 1, 0)Color_PID = VAR _FBPartnerID = MAX(Feedback[PartnerID]) IN UNION ( VALUES ( Partner[PartnerID] ), VALUES ( Partner[PartnerParentID] ) ) RETURN IF ( _FBPartnerID = TRUE (), 1, 0 )Steps for OrgID: Select Table visual - Format - Conditional formatting - find OrgID - Turn on Fond color - Format by Rules and select measure in based on field as below.
Result:
For more info to conditional formatting function: Use conditional formatting in tables
You can download the pbix file from this link: File
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi ihartdata
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou