Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
Status | DueDateTeamMember | OverdueTeamMember? |
In Progress | ||
In Progress | 12/8/2021 | No |
In Progress | ||
In Progress | 12/10/2021 | No |
In Progress | ||
In Progress | 12/1/2021 | Yes |
Draft | ||
Draft | ||
Draft |
Solved! Go to Solution.
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.
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.
@rsbin Hi there, thanks for help. It seems when I test this - it gives me error when there are blanks in the due date.
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.
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.
User | Count |
---|---|
75 | |
75 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |