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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Calcular el número de días laborables restantes en el mes actual

Hola a todos

Tengo una tabla de calendario donde estoy usando una columna calculada para calcular el número de días laborables en cada mes.

Necesito una fórmula para calcular el no. días laborables restantes en el mes actual y para devolver el no. días de trabajo en todos los demás meses.

Así, por ejemplo, en marzo, tengo un total de 21 días laborables y en base a la fecha de hoy, debería tener 3 días laborables restantes. Necesito esta fórmula para devolver el 3 de marzo y el total no. días de trabajo para enero, febrero, abril y así sucesivamente.

¡Gracias!

7 REPLIES 7
v-eachen-msft
Community Support
Community Support

Hola @kartiklal18 ,

Puede utilizar la función COUNTROWS() para calcular el resto de los días laborables.

Current Month =
IF (
    FORMAT ( TODAY (), "mmmm" ) = SELECTEDVALUE ( 'Table'[Column] ),
    COUNTROWS (
        FILTER (
            'Table',
            'Table'[Date] >= TODAY ()
                && NOT ( WEEKDAY ( 'Table'[Date], 1 ) IN { 1, 7 } )
        )
    ),
    [Working Day]
)

Aquí está el resultado.

3-1.PNG

Aquí está mi archivo de prueba para su referencia.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Hola @v-eachen-msft ,

Su solución funciona perfectamente y era exactamente lo que estaba buscando. ¡Gracias por la ayuda!

amitchandak
Super User
Super User

Si tiene que trabajar fecha

Días restantes á sumx(filter(Date,Date[Date]> á today() && Date[Date]<-eomonth(today(),0)),Date[Working Days])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hola @amitchandak ,

Su fórmula devuelve el no. de días de trabajo a la izquierda, pero también necesito que devuelva el no. de días restantes en todos los otros meses. Para marzo, devuelve correctamente 3 y lo necesito para devolver 21 para enero, 20 para febrero, 20 para abril...

Working Days Left.PNG

Por favor, vea la captura de pantalla adjunta.

Tratar

if(month(today()) = month(Date[Date]),
sumx(filter(Date,Date[Date]>= today() && Date[Date]<= eomonth(today(),0)),Date[Working Days]),
sumx(Date,Date[Working Days]))
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hola @amitchandak ,

Si uso una medida, la instrucción IF no me permitirá hacer referencia a mi columna de fecha en mi tabla de calendario y si uso una columna calculada obtengo el siguiente resultado,

Working Days Left.PNG

camargos88
Community Champion
Community Champion

Hola @kartiklal18 ,

Pruebe estas medidas:

WorkingDays - CALCULATE(COUNT('Date'[Date]); WEEKDAY('Fecha'[Fecha]; 1) en 2;3;4;5;6o)
WorkingDaysLeft á CALCULATE(COUNT('Date'[Date]); FILTRO('Fecha'; WEEKDAY('Fecha'[Fecha]; 1) en 2;3;4;5;6o && 'Fecha'[Fecha] > ? HOY() ))
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors