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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LucasMascarellD
Frequent Visitor

NETWORKDAYS PER MONTH DAX

HI,

I need to calculate the balance of working days for the current month and the number of working days for the following months,
I did this measure:

LucasMascarellD_0-1673713063156.png

It did´t work to calculante the balance of workings days for de current month, the result:

LucasMascarellD_1-1673713270133.png

In february it´s ok, but in january it´s need to return 12, today ( 01/14).

Someone can help me?

1 ACCEPTED SOLUTION

@LucasMascarellD 

I think I initially misunderstood your requirement. Please try

=
NETWORKDAYS (
MAX ( MIN ( Calendario[Date] ), TODAY () ),
MAX ( Calendario[Date] ),
1,
Feriados
)

View solution in original post

6 REPLIES 6
LucasMascarellD
Frequent Visitor

Didnt work
The result:

LucasMascarellD_0-1673783226415.png

With your measure is on the second line (teste3)

On first line (DiasUteis) I have the working days of the month, It is right.
But in January, needs to return 12, because we still have 12 days to the end of the month.

 Please create a measure 

    MIN (
        MAX ( Calendario[Date] ),
        TODAY ()
    )

and let me know what it returns. 

@LucasMascarellD

it´s return

LucasMascarellD_0-1673793476485.png

 

If I use this measure

LucasMascarellD_1-1673793674871.png

it´s return to me 12, but in other month returns 12 too and add a new column

LucasMascarellD_2-1673793833265.png

 

@LucasMascarellD 

I think I initially misunderstood your requirement. Please try

=
NETWORKDAYS (
MAX ( MIN ( Calendario[Date] ), TODAY () ),
MAX ( Calendario[Date] ),
1,
Feriados
)

My english is not the best, Maybe I didnt expresss my self inthe best way.

But the your measure works perfectly 

LucasMascarellD_0-1673794705005.png

It´s creating a new column with no title, Do you know why?

LucasMascarellD_1-1673794916638.png

 

tamerj1
Super User
Super User

Hi @LucasMascarellD 
Please use

=
NETWORKDAYS (
    MIN ( Calendario[Date] ),
    MIN (
        MAX ( Calendario[Date] ),
        TODAY ()
    ),
    1,
    Feriados
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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