cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper III

## Create a measure calculating Working Days

Dear Team,

I need your support to creeate a measure calculating number of working days knowing that Saturday & Friday days are off, i mean to exculude both "Friday & Satureday" from working days calculations.

Notes:

1-Rep name field name is: territory.

2-"Call Time" highlighted field is the right date and time.

Regards,

Mohsen

1 ACCEPTED SOLUTION
Super User

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Super User

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Helper III

Hi , I need it in a measure so i can put it in a card will display the working days as a number.

Regards,

Mohsen

Community Champion

Hi @Mohsen_2020 ,

1. There are seven rows without any data in your data table.

2. In Power Query split column Call Time in date part and time part.

3. Now you can calculate your workin days like this:

``````Sum of weekdays =
CALCULATE (
DISTINCTCOUNT ( report1617266304758[Date] ),
FILTER (
report1617266304758,
WEEKDAY ( report1617266304758[Date] ) IN { 1, 2, 3, 4, 5 }
)
)
``````

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Community Champion

Hi @Mohsen_2020 ,

open your data in Power Query and add a new column that holds the information 'Is Workingday'. 1 is workingday, 0 isn't workingday. Use the following M-code (4 = Friday, 5 = Saturday):

``= Table.AddColumn(#"Changed Type", "Is Workingday", each if Date.DayOfWeek([Call Time]) = 4 or Date.DayOfWeek([Call Time]) = 5 then 0 else 1, Int64.Type)``

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors