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" ,
)))
Ah, yes. Matrix vs table.
Every value in a matrix is assummed to be some sort of aggregation of data, grouped by the current row(s) and column(s). Values in a table are just pulled directly from a table. You were able to create the calculated table with no issues, but now the matrix is trying to aggregate those values.
You should be able to use this measure instead to return the proper value with the code:
SELECTEDVALUE('Taskbaselines'[task baseline finish date],BLANK())This will select the first value from whatever the current filter context is, or null if there are no options or multiple options.
If you start having problems with totals showing up that you don't want, you can see my recent adventure fighting with a matrix here: https://community.powerbi.com/t5/Desktop/Only-Total-Select-Values-in-a-Matrix-amp-Formatting-Help/m-p/710741#M343163
I will give this a shot. Thank you!