cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jcastr02
Post Prodigy
Post Prodigy

Help with calculated column

Need help with the measure below.  Looking to create a calculated column that will show either Yes or No dependent on  if  status is ="In Progress"  and if the due date is less than TODAY then mark Yes, otherwise No.   Also IF the DueDateTeamMember is blank, then also leave the OverdueDudeDateTeamMember blank

calculated column I have thus far:

OverdueTeamMember? = if(and('x-Coaching-Sharepoint'[Status]="In Progress",'x-Coaching-Sharepoint'[DueDateTeamMember]<>today()),"Yes","No")
 
Example Table
StatusDueDateTeamMemberOverdueTeamMember?
In Progress  
In Progress12/8/2021No
In Progress  
In Progress12/10/2021No
In Progress  
In Progress12/1/2021Yes
Draft  
Draft  
Draft  
2 ACCEPTED SOLUTIONS
rsbin
Impactful Individual
Impactful Individual

@jcastr02,

I have come to rely on the Switch Statement in DAX. I find it easier to track multiple conditions.

The following may not be exactly correct, but should get you close.

OverdueTeamMember = SWITCH(
                       TRUE(),
                       ISBLANK(DueDateTeamMember)=TRUE, Blank(),
               x-Coaching-Sharepoint'[Status]="In Progress" && 
               'x-Coaching-Sharepoint'[DueDateTeamMember]< Today(),"Yes",
                "No" )

You may have to play around with it a bit, if it doesn't work exactly.

View solution in original post

rsbin
Impactful Individual
Impactful Individual

@jcastr02,

Do not use IF and Switch together.   The SWITCH statement is an alternative to a nested IF statement. Each line is considered a condition:

OverdueTeamMember = SWITCH(
                       TRUE(),
                       ISBLANK( [DueDateTeamMember] )= TRUE, Blank(),
               [Status]="In Progress" && [DueDateTeamMember] < Today(),"Yes",
                "No" )

rsbin_0-1638561284254.png

Trust you should be able to get this to work in your file.

View solution in original post

6 REPLIES 6
jcastr02
Post Prodigy
Post Prodigy

@rsbin    Hi there, thanks for help.  It seems when I test this - it gives me error when there are blanks in the due date.

Screenshot 2021-11-05 144628.png

rsbin
Impactful Individual
Impactful Individual

@jcastr02,

In the first condition, replace Blank(), with "".

See if that works....

@rsbin  it looks like this is giving me an error Screenshot 2021-11-05 144628.png

rsbin
Impactful Individual
Impactful Individual

@jcastr02,

Do not use IF and Switch together.   The SWITCH statement is an alternative to a nested IF statement. Each line is considered a condition:

OverdueTeamMember = SWITCH(
                       TRUE(),
                       ISBLANK( [DueDateTeamMember] )= TRUE, Blank(),
               [Status]="In Progress" && [DueDateTeamMember] < Today(),"Yes",
                "No" )

rsbin_0-1638561284254.png

Trust you should be able to get this to work in your file.

View solution in original post

@rsbin Thank you!!! that worked 🙂

rsbin
Impactful Individual
Impactful Individual

@jcastr02,

I have come to rely on the Switch Statement in DAX. I find it easier to track multiple conditions.

The following may not be exactly correct, but should get you close.

OverdueTeamMember = SWITCH(
                       TRUE(),
                       ISBLANK(DueDateTeamMember)=TRUE, Blank(),
               x-Coaching-Sharepoint'[Status]="In Progress" && 
               'x-Coaching-Sharepoint'[DueDateTeamMember]< Today(),"Yes",
                "No" )

You may have to play around with it a bit, if it doesn't work exactly.

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors