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.
thank you rcharara for the response. I think something is being lost in tranlation. 🙂 when I view the dax query it says 'var orn'. I can't seem to translate this to a dax statement. Can you tell me what is meant by this by sending me a link to the ormula or translate to enlish. I can't seem to get what the orn stands for. 😐
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.