Forum Discussion

jcastr02's avatar
jcastr02
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

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 Y...
  • rsbin's avatar
    4 years ago

    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.

  • rsbin's avatar
    rsbin
    4 years ago

    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" )

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