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! Request now

Reply
jb_karlsson
Frequent Visitor

Error handling in creating duration custom column

Hi, I'm quite new to Power Bi and I'm currently trying to transform a timestamp column Seconds into a duration type of column.

But the null values generates an error and we don't want to remove or replace the null values before creating the duration column. Preferably the it should say null instead of Error in the new column.

Has anyone any solution for this?

Regards Johan

duration.png

 

durationerror.png

 

 

 

1 ACCEPTED SOLUTION

Hi @jb_karlsson ,

You can try to replace errors.

replace errors.gif

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
VasTg
Memorable Member
Memorable Member

@jb_karlsson 

 

Try this..

 

=if [Seconds] <> null then #duration(0,0,0,[Seconds]) else #duration(0,0,0,0)

 

If it helps, mark it as a solution.

Kudos are nice too

Connect on LinkedIn

Hi, no it didn't help, it removed the null values and replaced them with 0.00:00:00.

Regards Johan

Hi @jb_karlsson ,

You can try to replace errors.

replace errors.gif

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much.

Sometimes the answer is much easier then you expect:).

Anonymous
Not applicable

But it isn't supposed to be the case.

Why should I go through this workaround from the first place it doesn't supposed to generate an error, it doesn't make sense

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