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" ,
)))
Ugh. I hate messing with EARLIER/EARLIEST.
The root problem here is that when you evaluate this
ISBLANK('Taskbaselines'[task baseline finish date])DAX is returning a list of values. You're asking "Is this value blank?" and giving the function a whole column of values. DAX gives up and tells you there's an error. What you need is a way to select one of those values. Depending on the context you're in, you may be able to use SELECTEDVALUE, RELATED or some other aggregation function to get one value out of the list.
Is the table you're adding this column to the same one the value is in?
Hi Clint ,
Kindly share your sample data to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.
- Clint7 years ago
Helper V
Hi Frank,
It is proprietary in teh sense it is live data that refers to real products/dates from my company. All I'm really trying to do is show a RYG indicator when the variance between a milestones baseline and estimated dates is greater than certain parameters. The trick is, if there is no baseline date set, I want to suppress the RYG indicator (as otherwise it shows as "green" since the variance is calculated as 0. The problem is, BI thinks there is more than one value for"task baseline finish date" and expects me to aggregate this value.