Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
dinesharivalaga
Post Patron
Post Patron

Validate my DAX formula with my scenario

Hi Experts,

 

I have wrote the DAX formula for my scenario as below :

 

if "Do we have required resourcing for the project?"is no, then Amber

if "Are there attritions/Backfill delayed?" is Yes, then Amber

if "Are we having any skill issues in the team?" if Yes, then Red

if any one of them is red above, then Red, if none of them red and any one of them amber then Amber

DAX :

Resourcing logic =
var _if1=
IF('Test Delivery Updates'[Do we have required resourcing for the project?]="No","Amber",BLANK())
var _if2=
IF('Test Delivery Updates'[Are there attritions/Backfill delayed?]="Yes","Amber",BLANK())
var _if3=
IF('Test Delivery Updates'[Are we having any skill issues in the team?]="Yes","Red",BLANK())
var _text=
_if1&"-"&_if2&"-"&_if3
return
IF(
    CONTAINSSTRING(_text,"Red")=TRUE(),"Red","Amber")

 

dinesharivalaga_0-1726148916518.png

 

It is working fine when all the columns are updated with Yes or No , but i need to update the DAX like "if all the columns are blank then the output (Resourcing logic column) should give BLANK" .

 

FYI : With the current formula it is showing "Amber" when all columns are blank.
I have tried few changes but not worked as expected.

 

Can anyone please help to check and solve me with the updated DAX ?

 

Thanks

DK

2 REPLIES 2
DataInsights
Super User
Super User

@dinesharivalaga,

 

Try this calculated column:

 

Resourcing logic =
VAR _if1 =
    IF (
        'Test Delivery Updates'[Do we have required resourcing for the project?] = "No",
        "Amber",
        BLANK ()
    )
VAR _if2 =
    IF (
        'Test Delivery Updates'[Are there attritions/Backfill delayed?] = "Yes",
        "Amber",
        BLANK ()
    )
VAR _if3 =
    IF (
        'Test Delivery Updates'[Are we having any skill issues in the team?] = "Yes",
        "Red",
        BLANK ()
    )
VAR _text = _if1 & "-" & _if2 & "-" & _if3
RETURN
    SWITCH (
        TRUE,
        ISBLANK ( _if1 ) && ISBLANK ( _if2 ) && ISBLANK ( _if3 ), BLANK (),
        IF ( CONTAINSSTRING ( _text, "Red" ) = TRUE, "Red", "Amber" )
    )

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@DataInsights  Thanks for a solution 🙂
I have tried to modify the formula as below and after that it is giving result as "Red" for all the accounts instead of a specific account , i don't know why 😞

dinesharivalaga_0-1726224349726.png

 

dinesharivalaga_1-1726225499103.png

 

for example :

AccountQ1Q2Q3Resourcing
XYZNo  Amber
ABCYes  Red
AAA No Red
BBB   Red
CCC   Red
DDD   Red



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.