Forum Discussion
DAX IF Function with 2 connected tables
- 7 years ago
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" ) )
AkhilAshok Works properly, thank you a lot for your help!!
Could you please help me with the same logic for Business Unit Level? For you it would take only a few minutes and it would save my life!
So if BU has critical and major it shows "red" in the Service Dashboard.
If a BU has critical it shows "red" in the Service Dashboard
If a BU has major it shows "yellow" in the Service Dashboard
If a BU has no incident it shows "green" in the Service Dashboard
Or in other words:
If a BU has red and yellow, then it should show red.
If a BU has green and yellow, then it should show yellow.
If a BU has green and red, then it should show red.
If a BU has only 1 colour, then that colour.
Thank you already in advance!
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" ) )