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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Dain
Frequent Visitor

dispaly Duration

Hi All...

 

Help needed one more time.

I have two Time columns in my table.I want to find the difference of time and append this duration with some text.

 

time1           time 2              remarks

02:30:00     03:00:00     duration is 30 Minutes

21:00:00     22:30:00     duration is 1hour30Minutes

 

Can someone please help.Thanks.

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Dain,

 

Try out this formula please.

remarks =
VAR minutes =
    DATEDIFF ( [time1], [time2], MINUTE )
VAR h =
    INT ( minutes / 60 )
VAR m =
    MOD ( minutes, 60 )
RETURN
    IF (
        h = 0,
        "Duration is " & m
            & " Minutes",
        "Duration is " & h
            & " hours "
            & m
            & " Minutes"
    )

display_duration

 

Best Regards,

Dale

Community Support Team _ Dale
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
v-jiascu-msft
Employee
Employee

Hi @Dain,

 

Try out this formula please.

remarks =
VAR minutes =
    DATEDIFF ( [time1], [time2], MINUTE )
VAR h =
    INT ( minutes / 60 )
VAR m =
    MOD ( minutes, 60 )
RETURN
    IF (
        h = 0,
        "Duration is " & m
            & " Minutes",
        "Duration is " & h
            & " hours "
            & m
            & " Minutes"
    )

display_duration

 

Best Regards,

Dale

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

Thank You so much for the Answer!.

 

I am struggling to implement another logic.Could you please have a look on it.

 

I have a date slicer with start and end dates.I want to find the first working day of month for each months tat comes in that slicer start n end dates.For each first working day,i want to execute a specific logic.How can i do it dynamically

Hi @Dain,

 

My pleasure. Seems it's a new topic. I would suggest you create a new thread in this forum. If you can post a sample, that would be helpful for the community to work out an answer.

 

Best Regards,

Dale

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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