Anonymous
7 years agoNot applicable
DAX IF Function with 2 connected tables
Hey guys,
I'm new to the world of DAX Formulas and would need a bit of a help with an "IF" Function.
I have 2 tables that are connected to each other based on service ID: "Service Dashboard" and "Incident Report".
What I want to do is making a coloumn called Service Status into the Service Dashboard table with the following conditions:
- if a service has a Critical Incident it should show/write "red"
- if a service has a Major Incident it should show/write "yellow"
- if a service has both Major and Critical Incident it should show/write "red"
Could you please help me out?
Any help is greatly appreciated!
Many thanks!
Adam
A calculated column like this might help:
BU Status = VAR BU = 'ServiceDashboard'[Business Unit] VAR HasRed = CONTAINS ( 'ServiceDashboard', 'ServiceDashboard'[Business Unit], BU, 'ServiceDashboard'[Service Status], "red" ) VAR HasYellow = CONTAINS ( 'ServiceDashboard', 'ServiceDashboard'[Business Unit], BU, 'ServiceDashboard'[Service Status], "yellow" ) RETURN IF ( HasRed, "red", IF ( HasYellow, "yellow", "green" ) )