Forum Discussion
Using isBlank to return blank when no value provided in a field
- 7 years ago
Hi CMcMahan,
After futzing w/this a bit, I finally got it to work correctly with this DAX:
Updated PR MS Indicator calc
M_Task MS RYG2 =
If(
isBlank(Max('taskbaselines'[Task Baseline Finish Date])),
BLANK(),
If(MAX('Tasks'[Task Finish Variance Days])<=7,"https://Aristocratgaming.sharepoint.com/sites/pwa/_api/Projectdata/_layouts/15/inc/PWA/images/cf_6p.png" ,
if(MAX('tasks'[Task Finish Variance Days])>=21,"https://Aristocratgaming.sharepoint.com/sites/pwa/_api/Projectdata/_layouts/15/inc/PWA/images/cf_2p.png" ,
)))
Hello Cmcmahan,
I was able to work in the Selected Value option you outlined in the following calculation
Hmm... that looks like it should work. So we get to start debugging.
Can you create a few test measures and put them into the table for me?
Test1 = SELECTEDVALUE('TaskBaselines'[Task Baseline Finish Date])Test2 = 'tasks'[Task Finish Variance Days]
If you don't get the expected values for these, then we know what part of the main C_Task MS RYG2 indicator we need to examine/fix.
- Clint7 years agoHelper V
Hi CMcMahan,
After futzing w/this a bit, I finally got it to work correctly with this DAX:
Updated PR MS Indicator calc
M_Task MS RYG2 =
If(
isBlank(Max('taskbaselines'[Task Baseline Finish Date])),
BLANK(),
If(MAX('Tasks'[Task Finish Variance Days])<=7,"https://Aristocratgaming.sharepoint.com/sites/pwa/_api/Projectdata/_layouts/15/inc/PWA/images/cf_6p.png" ,
if(MAX('tasks'[Task Finish Variance Days])>=21,"https://Aristocratgaming.sharepoint.com/sites/pwa/_api/Projectdata/_layouts/15/inc/PWA/images/cf_2p.png" ,
)))
- Clint7 years agoHelper V
Hi CMcMahan,
So, I had an opportunity to work w/this some more today and found - if I use a measure in the TaskBaselines table, I am getting closer to the right result.M_Task MS RYG2 =If(Not isBlank(Max('taskbaselines'[Task Baseline Finish Date])),(SELECTEDVALUE('TaskBaselines'[Task Baseline Finish Date],If(max('Tasks'[Task Finish Variance Days])<=7,"https://Aristocratgaming.sharepoint.com/sites/pwa/_api/Projectdata/_layouts/15/inc/PWA/images/cf_6p.png" ,if(max('tasks'[Task Finish Variance Days])>=21,"https://Aristocratgaming.sharepoint.com/sites/pwa/_api/Projectdata/_layouts/15/inc/PWA/images/cf_2p.png" ,This returns nothing for the cell that should be blank but, for the other cells that should have an indicator, it is returning the baseline date. - Cmcmahan7 years agoResident Rockstar
Nice man! That looks good! Glad you were able to figure it out
- Clint7 years agoHelper V
Thank you! I could not have done it w/o your help. As a rank newbie to DAX, I find it invaluable to be able to work thru a solution w/someone so thank you.