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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
frankhofmans
Helper IV
Helper IV

Cambiar la fórmula de los días laborables en días calendario

Estimados expertos en PBI,

Hace unos meses, el apoyo de la comunidad me ayudó con una pregunta sobre contar los días laborables entre una fecha de inicio y una fecha de finalización. Tengo la siguiente solución:

----------------------------------------

Cálculo necesario ?
Fecha de inicio de VAR (VAR StartDate)
MAX ( MIN ( 'Calenda'[Fecha] ), MIN ( 'Resultados'[Start_Date] ) )
Fecha de finalización del VAR (VAR EndDate)
MIN ( MAX ( 'Calenda'[Fecha] ), MAX ( 'Resultados'[End_Date] ) )
devolución
SI (
Fecha de inicio <- EndDate,
COUNTROWS (
FILTRO ( CALENDARIO ( StartDate, EndDate ), WEEKDAY ( [Fecha], 3 ) <-5 )
),
0

-------------------------------------------------------------------------------------------

Quiero cambiar el número de días laborables en el número de días calendario, así que tengo que cambiar la función de día de la semana, pero no obtengo el resultado correcto. ¿Alguien tiene una solución para esto?

Muchas gracias de antemano,

Saludos, Frank

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@frankhofmans

Pruebe esta medida por favor:

Calculation needed =
VAR StartDate =
    MAX ( MIN ( 'Calenda'[Date] ), MIN ( 'Outcomes'[Start_Date] ) )
VAR EndDate =
    MIN ( MAX ( 'Calenda'[Date] ), MAX ( 'Outcomes'[End_Date] ) )
RETURN
    IF (
        StartDate <= EndDate,
        COUNTROWS (
            FILTER ( CALENDAR ( StartDate, EndDate ), WEEKDAY ( [Date], 3 ) <= 4 )
        ),
        0

________________________

Si mi respuesta fue útil, haga clic en Aceptarla como la solución para ayudar a otros miembros a encontrarla útil

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂


Sitio web Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hola, @frankhofmans


Para excluir los fines de semana, puede probar la siguiente medida para ver si ayuda.

Calculation needed =
VAR StartDate =
    MAX ( MIN ( 'Calenda'[Date] ), MIN ( 'Outcomes'[Start_Date] ) )
VAR EndDate =
    MIN ( MAX ( 'Calenda'[Date] ), MAX ( 'Outcomes'[End_Date] ) )
RETURN
    IF (
        StartDate <= EndDate,
        COUNTROWS (
            FILTER (
                CALENDAR ( StartDate, EndDate ),
                NOT ( WEEKDAY ( [Date] ) ) IN { 1, 7 }
            )
        ),
        0
    )

Saludos

Allan

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Fowmy
Super User
Super User

@frankhofmans

Pruebe esta medida por favor:

Calculation needed =
VAR StartDate =
    MAX ( MIN ( 'Calenda'[Date] ), MIN ( 'Outcomes'[Start_Date] ) )
VAR EndDate =
    MIN ( MAX ( 'Calenda'[Date] ), MAX ( 'Outcomes'[End_Date] ) )
RETURN
    IF (
        StartDate <= EndDate,
        COUNTROWS (
            FILTER ( CALENDAR ( StartDate, EndDate ), WEEKDAY ( [Date], 3 ) <= 4 )
        ),
        0

________________________

Si mi respuesta fue útil, haga clic en Aceptarla como la solución para ayudar a otros miembros a encontrarla útil

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂


Sitio web Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@frankhofmans

La fórmula actual cuenta los días en los que el día de la semana no es domingo. ¿cómo desea realizar el cálculo ahora?

________________________

Si mi respuesta fue útil, haga clic en Aceptarla como la solución para ayudar a otros miembros a encontrarla útil

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂


Sitio web Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

hola Fowmy,

Necesito que todos los días de la semana, incluidos los sábados y domingos, cuenten todos los días entre la fecha de inicio y la fecha de finalización.

Gracias de antemano,

Frank

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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