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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
dmcnamee
Frequent Visitor

Convert Jodatime period field to Time

Hi,

 

I'm new to Power BI and to the forum. 

 

I'm pulling data from a PostgreSQL database where one of the fields is a Java Jodatime Period representation. (https://www.joda.org/joda-time/)

 

As can be seen from the screenshot below, this is stored in a varchar(255) as PT30M (representing a Period of 30 minutes. Jodatime Period in DatabaseJodatime Period in Database

 

Has anyone ever worked with converting Jodatime Date/Time representations to something that can be interperted by Power BI?

 

Thanks!

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @dmcnamee 

To format the column, follow the steps below.
1. Click on abc123 icon in your column.

2. Select "Time" Data Type as below
image.png

Regards,
Mariusz

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

4 REPLIES 4
dmcnamee
Frequent Visitor

Hi Marius,

That appears to have done the trick. Thanks!

 

 

jodatime_2.png

 

However, the new Custom Column I just created is of type Text

It would be great if it could be formatted to type Time

 

I've tried the following to convert it to Time

 

Time.FromText([parsed_total_time])

jodatime_3.png

 

 

But it's giving an error: 

 

jodatime_4.png

 

Why is the error stating that it cannot convert the value to type Text, when I'm asking it to convert it to a type Time?

 

Many thanks,

Donal. 

Mariusz
Community Champion
Community Champion

Hi @dmcnamee 

To format the column, follow the steps below.
1. Click on abc123 icon in your column.

2. Select "Time" Data Type as below
image.png

Regards,
Mariusz

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

@Mariusz

That worked a treat!  🙂

Thanks a million for your help, 

Donal. 

Mariusz
Community Champion
Community Champion

Hi @dmcnamee 

You can add a custom column in Query Editor, like below.

 

image.png

 

Regards,
Mariusz

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.