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
colem246
Frequent Visitor

Exclude Null Data from Subtraction

Hello,

 

Im subtracting two columns that both include the date. Some of the cells are empty because no dates are available for the information.. How can I exclude the null information in the measure?

 

What I have so far is:

 

FirstTime = 'Activity '[First Time]-'Activity [Activity Date]

 

The result I get for the null values is just "12:00:00AM" but I would rather not have the data show.

 

Thanks

11 REPLIES 11
Interkoubess
Solution Sage
Solution Sage

Hi @colem246,

 

 

Please try something with an if like this:

 

if(isblank( or('Activity '[First Time]), 'Activity [Activity Date])),blank(), Activity '[First Time])-'Activity [Activity Date])

Let us know if it does not work...

 

Ninter

This is still giving me 12:00am even when the 'Activity '[First Time] is blank.

 

 

hi @colem246,

 

Please give a sample data with your expected result and then I can try another approach.

 

Ninter

Here is an example of what it looks like. The last two columns are using the code you gave me. As you can see the columns at the top have missing data and still gives 12:00am in the last two columns. I would rather the last two columns be null.

 

ThanksPower BI Desktop Question.PNG

Hi @colem246,

 

Could you change the postion of the Or condition like( replace the fields with the correct names):

 

Or(isblank(), isblanck())

I will make a try when I get a computer with Powerbi desktop.

But let me know.

 

Ninter

Hi @colem246,

 

I tried the second approach proposed and it worked! 

Please try it and let me know if you have any issues.

 

IF(OR(ISBLANK('Activity First and Last'[First Arrival]),ISBLANK('Activity First and Last'[Activity Date])),BLANK(),'Activity First and Last'[Activity Date]-'Activity First and Last'[First Arrival])

Ninter

Hi Ninter,

 

I am still getting an error.Power BI.PNG

Hi @colem246,

 

Are you creating this calculation as a column and not a measure?

 

 I created as a calculated column. Let me know if it is the case.

 

Ninter

I am using measure for this because I am ultimately going to be calculating the average time of the first, last, etc.....

 

Using a calculated column wouldnt allow for this type manipulation will it? Also, I only want the time stamp to show, not date and time since date is already populated in the activity date column.

 

Thanks

Then use the formula with or with a combination of Datediff.

 

It should work...

 

Ninter.

Hi @colem246,

Have you resolved your issue? If you have, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Best Regards,
Angelia

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