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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Junaid11
Helper V
Helper V

Total Workdays in a month without breakdown

Hello,
I have got a formula which shows number of working days but if weekend it shows blank which is working fine and formula is given below:

WorkdayCount = IF(
    NOT(WEEKDAY(PBI_ARInvoices[InvoiceDate]) IN {1, 7}),
    RANKX(
        FILTER(
            PBI_ARInvoices,
            PBI_ARInvoices[Month NO] = EARLIER(PBI_ARInvoices[Month NO]) &&
            NOT(WEEKDAY(PBI_ARInvoices[InvoiceDate]) IN {1, 7})
            ),
        PBI_ARInvoices[InvoiceDate].[Date],
        , ASC, Dense))
 
 
Second formula is total monthly working days which is also given below:
MOnthly Working Days =
    COUNTX (
        FILTER (
            VALUES(PBI_ARInvoices[InvoiceDate]),
            WEEKDAY ( PBI_ARInvoices[InvoiceDate], 1 ) <> 1
                && WEEKDAY ( PBI_ARInvoices[InvoiceDate], 1 ) <> 7
        ),
        PBI_ARInvoices[InvoiceDate]
    )
 
I want to divide each working day with total monthly working days like if working day number today is 18 and October has 21 total working days then 18 divide by 21
but when I put them in table the total monthly number breakddoen like below :
sacdvfgg.PNG
I want outcome like below:
DateMonthDayWorking Day NOMonthly Working Day
08/09/2022SeptemberThursday622
08/09/2022SeptemberThursday622
12/09/2022SeptemberMonday822
12/09/2022SeptemberMonday822
22/09/2022SeptemberThursday1622
24/09/2022SeptemberSaturday 22
25/09/2022SeptemberSunday 22
25/09/2022SeptemberSunday 22
28/09/2022SeptemberWednesday2022
29/09/2022SeptemberThursday2122
30/09/2022SeptemberFriday2222
11/10/2022OctoberTuesday721

Kindly help me get updated formula without total monthly to breakdown.
Thank you

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Junaid11 Try this:

Monthly Working Days =
  VAR __Date = MAX(PBI_ARInvoices[InvoiceDate])
  VAR __Min = DATE(YEAR(__Date),MONTH(__Date),1)
  VAR __Max = EOMONTH(__Min,0)
RETURN
  NETWORKDAYS(__Min, __Max)

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

@Junaid11 Try this:

Monthly Working Days =
  VAR __Date = MAX(PBI_ARInvoices[InvoiceDate])
  VAR __Min = DATE(YEAR(__Date),MONTH(__Date),1)
  VAR __Max = EOMONTH(__Min,0)
RETURN
  NETWORKDAYS(__Min, __Max)

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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