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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Reducing Characters in Time Duration

I created a time signature for how long it took our team to complete a segment within our process. But it has given me a ton of numbers at the end of the duration. This may be a rookie question but for the life of me, I cannot shorten this to be just a normal time signature.

 

Ashton_Quincey_0-1664239369895.png

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

First extract value before the second ".", then transform this column to Duration type again. 

vjingzhang_0-1664335308057.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
wdx223_Daniel
Super User
Super User

you can use the function of Duration.TotalDays to transform the durations to days.

 

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

First extract value before the second ".", then transform this column to Duration type again. 

vjingzhang_0-1664335308057.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Greg_Deckler
Super User
Super User

@Anonymous Try below. Note, I used Colum from examples.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstQzMLUyNLAysdCzNDM1AAKlWJ1oJQs9I2MrY3MrI0s9QxMjJGEDAyugjImRnqWlMUQ4FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type duration}}),
    #"Inserted Text Before Delimiter" = Table.AddColumn(#"Changed Type", "Text Before Delimiter", each Text.BeforeDelimiter(Text.From([Column1], "en-US"), ".", 1), type text),
    #"Changed Type1" = Table.TransformColumnTypes(#"Inserted Text Before Delimiter",{{"Text Before Delimiter", type duration}})
in
    #"Changed Type1"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.