Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
StoryofData
Helper III
Helper 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?

 

StoryofData_0-1686237113347.png

 

1 ACCEPTED SOLUTION

sure 🙂

 

Date Closed Blank = COALESCE(FORMAT(CALCULATE(MAX('Query1'[DateClosed])),"MM/DD/YYYY") , "Still Open")

View solution in original post

7 REPLIES 7
lbendlin
Super User
Super 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")

Thank you! So there is no way to have only one measure to achieve this?

sure 🙂

 

Date Closed Blank = COALESCE(FORMAT(CALCULATE(MAX('Query1'[DateClosed])),"MM/DD/YYYY") , "Still Open")

For some reason, it produces a blank instead of "Still Open", meaning the card does not show anything at all. Could there be an issue?

=COALESCE
(FORMAT(CALCULATE(MAX('Query1'[DateClosed])),"MM/DD/YYYY"),"Still Open")

Ah, right, I remember. There is a bug in FORMAT that happily returns an empty string instead of BLANK().

 

Oh well, back to your version.

 

=IF(ISBLANK(MAX('Query1'[DateClosed])),"Still Open",FORMAT(MAX('Query1'[DateClosed]),"MM/DD/YYYY"))

 

Thank you! Works now!

And, interesting, I guess that bug can be used to our advantage in some cases

Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.