Forum Discussion
Getting zero all rows instead of replacing only blanks with zeros
- 5 years ago
A few comments/suggestions:
1. You don't need to put CALCULATE around those expressions. Just MAX() will work in this case.
2. If you project status only ever improves, your approach with MAX will work, but if project ever have setbacks and the progress values goes backwards, your measure will still just be getting the max progress.
3. The "+0" approach is useful sometimes. In this case, it is evaluating the measure for all the Date values in the Update table and always returning at least 0, which is why you have the extra rows. If you don't have any rows there, there will not be a date value either. Would it work to use the TD column from the Milestones table instead? You could then use a measure like this to return 0 if there are no rows
Status = IF(ISBLANK(COUNTROWS(Updates)), 0, MAX(Updates[Update]))
Regards,
Pat
A few comments/suggestions:
1. You don't need to put CALCULATE around those expressions. Just MAX() will work in this case.
2. If you project status only ever improves, your approach with MAX will work, but if project ever have setbacks and the progress values goes backwards, your measure will still just be getting the max progress.
3. The "+0" approach is useful sometimes. In this case, it is evaluating the measure for all the Date values in the Update table and always returning at least 0, which is why you have the extra rows. If you don't have any rows there, there will not be a date value either. Would it work to use the TD column from the Milestones table instead? You could then use a measure like this to return 0 if there are no rows
Status = IF(ISBLANK(COUNTROWS(Updates)), 0, MAX(Updates[Update]))
Regards,
Pat
Thank you, I wrapped the function in MAXX, so I can iterate on the milstones table using your expression.
This gave me a closer much better results