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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
carlosagarcia
Helper I
Helper I

Recuento de días de la semana para calcular el tiempo de entrega

Hola chicos.

Estoy tratando de crear una medida que sólo cuenta los días de la semana para calcular la entrega de un artículo.

Tengo un plazo de compra de 10 días, si el pedido se introduce hoy 06/12/2020, el tiempo estimado de entrega debe ser 06/25/2020

Fecha de entrega del plazo de entrega de la parte

123 10 ???

Sé que suena fácil, he probado diferentes métodos sin suerte.

5 REPLIES 5
v-eachen-msft
Community Support
Community Support

Hola @carlosagarcia ,

Debe crear una dimensión de fecha.

Date =
CALENDAR ( DATE ( 2020, 01, 01 ), DATE ( 2020, 12, 31 ) )

A continuación, cree columnas para mostrar los días laborables y el total en ejecución.

Count =
VAR a = WEEKDAY ( 'Date'[Date], 2 ) RETURN IF ( a < 6, 1, 0 )
Sum =
CALCULATE (
    SUM ( 'Date'[Count] ),
    FILTER ( 'Date', 'Date'[Date] <= EARLIER ( 'Date'[Date] ) )
)

Cree una medida para mostrar la fecha.

Measure =
VAR a =
    SELECTEDVALUE ( 'Table'[Date] )
VAR b =
    SELECTEDVALUE ( 'Table'[Days] )
VAR c =
    CALCULATE ( MAX ( 'Date'[Sum] ), FILTER ( 'Date', 'Date'[Date] = a ) )
RETURN
    CALCULATE (
        MAX ( 'Date'[Date] ),
        FILTER ( 'Date', 'Date'[Sum] = b + c - 1 && 'Date'[Count] = 1 )
    )

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.

Hola

Estoy listo para probar su respuesta, pero me quedo atascado en la columna Messure.

Recibo un error en

Medidas ?
VAR a ?
SELECTEDVALUE ( 'Tabla'[Fecha] ), Necesito que esta sección sea hoy ot la fecha de mañana.
No tengo fecha para pasar, sólo estoy asumiendo que si las piezas se ordenan hoy o mañana, cuál debe ser la fecha prevista.
Intenté crear una columna con la fecha de hoy, pero la messure no la ve.
¿Alguna idea?

Hola @carlosagarcia ,

Cámbialo a HOY() o TODAY()+1.

var a = TODAY()

Asegúrese de que la dimensión de fecha tenga todas las fechas que necesite en el futuro.

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

@carlosagarcia , Tener una tabla de fechas con el siguiente campo

Table
Date = CALENDAR(date(2018,01,01), date(2021,12,31)) 
Columns
Work Day = if(WEEKDAY([Date],2)>=6,0,1) 
Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date])  
Work Date Cont = if([Work Day]=0,maxx(FILTER('Date',[Date]<EARLIER([Date]) && [Work Day]<> EARLIER([Work Day]) ),[Date]),[Date])
Work Date cont Rank = RANKX(ALL('Date'),[Work Date Cont],,ASC,Dense)

Use Rank to Travel . Example Measure
Plus 10 Days = var _max =maxx(ALLSELECTED('Date'),'Date'[Work Date cont Rank])
return CALCULATE(Min('Date'[Date]),filter(ALL('Date'),'Date'[Work Date  Rank] =_max+10))

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únase a ella con la columna de fecha de su/s hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

No estoy completamente seguro de cómo hacer esto,

Creo una nueva columna y luego pego la fórmula dada, pero no puedo usarla. justo después de la columna tengo errores infraligados en rojo

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors