Forum Discussion
Using isBlank to return blank when no value provided in a field
Hello,
Trying to use the following as part of an if statement to suppress the return of a RYG indicator but getting the error "A single value cannot be determined for column "Task Finish Baseline Date" in Table Task Baselines..... I created this as a calculated column as I thought this would avoid this sort of error. Shouldn't this expression be evaluated row by row against this table? This would return a single value in this column if so. Any thoughts on why this is returning this error?
C_Task MS RYG = If(isBlank('Taskbaselines'[task baseline finish date]), BLANK(),
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" ,
)))
15 Replies
- Cmcmahan
Resident Rockstar
When calculating a column, try this to get a single value:
C_Task MS RYG = If(isBlank(EARLIER('Taskbaselines'[task baseline finish date])), BLANK(),- Cmcmahan
Resident Rockstar
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?