Forum Discussion
StoryofData
3 years agoHelper III
Empty Date Value
Wondering if there a smart way to do this, I have table with cases and their open and closed dates.
For the times when the case is still open, I want the card to show "Still Open", I have achieved this using two measures:
Date Closed = CALCULATE(MAX('Query1'[DateClosed]))
Date Closed Blank = IF( ISBLANK([Date Closed]) , "Still Open", [Date Closed] )
Is there a smarter way to achieve this, without using two measures?
sure 🙂
Date Closed Blank = COALESCE(FORMAT(CALCULATE(MAX('Query1'[DateClosed])),"MM/DD/YYYY") , "Still Open")
7 Replies
- lbendlinSuper User
Your approach will only work when [Date Closed] is of type text.
You can use COALESCE
Date Closed = FORMAT(CALCULATE(MAX('Query1'[DateClosed])),"MM/DD/YYYY")Date Closed Blank = COALESCE([Date Closed] , "Still Open")- StoryofDataHelper III
Thank you! So there is no way to have only one measure to achieve this?
- lbendlinSuper User
sure 🙂
Date Closed Blank = COALESCE(FORMAT(CALCULATE(MAX('Query1'[DateClosed])),"MM/DD/YYYY") , "Still Open")