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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Calculate days between completion date and today with error for blanks

Hello
 
I'm trying to work out the days between 2 dates and have an error for blanks. 
 
Currently I'm using this which calculates between the expiry date and today. 
Expired days = value(TODAY()) - value('learning obj'[Actual Expiry Date])
 
This works fine until the expiry date is blank. How can I add in so that if its got no expiry date it says no expiry date instead?
 
 
1 ACCEPTED SOLUTION
Mohammad_Refaei
Solution Specialist
Solution Specialist

I assume you are using a calculated column not a measure and it will be difficult to have different data types like numerical figures and text values. I would return a standard value in response to blank expiry date like 99999.

Expiry Days =
IF (
    'learning obj'[Actual Expiry Date] = BLANK (),
    99999,
    TODAY () - 'learning obj'[Actual Expiry Date]
)

 

if you are ok with storing the days in text format then you can use a formula like this:

Expiry Days =
IF (
    'learning obj'[Actual Expiry Date] = BLANK (),
    "No Expiry Date",
    FORMAT ( TODAY () - 'learning obj'[Actual Expiry Date], 0 )
)

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Work perfectly. 

 

Thank you 🙂 

Mohammad_Refaei
Solution Specialist
Solution Specialist

I assume you are using a calculated column not a measure and it will be difficult to have different data types like numerical figures and text values. I would return a standard value in response to blank expiry date like 99999.

Expiry Days =
IF (
    'learning obj'[Actual Expiry Date] = BLANK (),
    99999,
    TODAY () - 'learning obj'[Actual Expiry Date]
)

 

if you are ok with storing the days in text format then you can use a formula like this:

Expiry Days =
IF (
    'learning obj'[Actual Expiry Date] = BLANK (),
    "No Expiry Date",
    FORMAT ( TODAY () - 'learning obj'[Actual Expiry Date], 0 )
)

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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