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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AndreT
Helper I
Helper I

Calculate in hours opportunities

during

Hi guys,
I am looking for a formula which would allow me to mark opportunities which arise  working hours.

 

I have already created created formula which shows me days of a week Day = FORMAT(MatchedTraders[createdAt Date],"DDDD")

 

I also have column with Created time

All I need is now a column which says:

 

In hours opportunities = if [Day] = Saturday or Sunday and [created_Time] 10am to 1pm, if [Day] =Monday to Friday and [created_Time] 8am to 6pm, "in hours", "outside working hours")

 

Does anyone know how to construct such calculation?

 

Many thanks in advance

Andre

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@AndreT

 

Try this calculated Column

 

=
IF (
    OR (
        OR ( MatchedTraders[Day] = "Sunday", MatchedTraders[Day] = "Saturday" )
            && HOUR ( MatchedTraders[Created Time] ) >= 10
            && HOUR ( MatchedTraders[Created Time] ) < 13,
        MatchedTraders[Day] <> "Sunday"
            && MatchedTraders[Day] <> "Saturday"
            && HOUR ( MatchedTraders[Created Time] ) >= 8
            && HOUR ( MatchedTraders[Created Time] ) < 18
    ),
    "in hours",
    "outside working hours"
)

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@AndreT

 

Try this calculated Column

 

=
IF (
    OR (
        OR ( MatchedTraders[Day] = "Sunday", MatchedTraders[Day] = "Saturday" )
            && HOUR ( MatchedTraders[Created Time] ) >= 10
            && HOUR ( MatchedTraders[Created Time] ) < 13,
        MatchedTraders[Day] <> "Sunday"
            && MatchedTraders[Day] <> "Saturday"
            && HOUR ( MatchedTraders[Created Time] ) >= 8
            && HOUR ( MatchedTraders[Created Time] ) < 18
    ),
    "in hours",
    "outside working hours"
)

Perfect it worked. Thank you!

 

@AndreT,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

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

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.