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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors