Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hola, tengo una tabla que muestra una fecha de creación para cuando se introducen facturas en nuestro sistema. Necesito agregar días laborables a esta fecha para obtener nuestra fecha de SLA. Tengo una mesa de fechas que tiene un índice de día de la semana incluido con los días 1-5 (sábado y domingo incluidos como día 5). Necesito añadir los días laborables a la fecha de creación. Las dos tablas se conectan por fecha de creación desde el archivo Facturas y Fechas de la tabla Fecha. Cualquier ayuda sería muy apreciada.
Solved! Go to Solution.
Hola @Lesley1Storey ,
No sé si desea una columna calculada o una medida, pero puede hacer lo siguiente.
Cree una columna en la tabla de calendario
Workday =
SWITCH (
TRUE ();
WEEKDAY('Calendar'[Date]) IN { 6 ; 7 }; FALSE ();
TRUE ()
)
Ahora agregue la siguiente medida a su modelo:
Forecasted End Date =
----------------------------------------------------------
VAR relevantdate =
SELECTEDVALUE(Invoices[Date]) --this can be replaced by TODAY()
VAR workdaysremain =
15 --Can be adjusted to be another value
---------------------------------------------------------
/* create a virtual date table only for working days starting from
the relevant date and only for the workdays remaining */
VAR workingdateTable =
TOPN (
workdaysremain;
CALCULATETABLE (
'Calendar';
'Calendar'[Workday] = TRUE ();
'Calendar'[Date] >= relevantdate
)
)
---------------------------------------------------------
/* find the maximum date in the virtual table, which will be
the forecasted end date */
VAR futuredate =
CALCULATE ( MAX ( 'Calendar'[Date] ); workingdateTable )
---------------------------------------------------------
RETURN
futuredate
esto fue adaptado del siguiente post:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHola @Lesley1Storey ,
No sé si desea una columna calculada o una medida, pero puede hacer lo siguiente.
Cree una columna en la tabla de calendario
Workday =
SWITCH (
TRUE ();
WEEKDAY('Calendar'[Date]) IN { 6 ; 7 }; FALSE ();
TRUE ()
)
Ahora agregue la siguiente medida a su modelo:
Forecasted End Date =
----------------------------------------------------------
VAR relevantdate =
SELECTEDVALUE(Invoices[Date]) --this can be replaced by TODAY()
VAR workdaysremain =
15 --Can be adjusted to be another value
---------------------------------------------------------
/* create a virtual date table only for working days starting from
the relevant date and only for the workdays remaining */
VAR workingdateTable =
TOPN (
workdaysremain;
CALCULATETABLE (
'Calendar';
'Calendar'[Workday] = TRUE ();
'Calendar'[Date] >= relevantdate
)
)
---------------------------------------------------------
/* find the maximum date in the virtual table, which will be
the forecasted end date */
VAR futuredate =
CALCULATE ( MAX ( 'Calendar'[Date] ); workingdateTable )
---------------------------------------------------------
RETURN
futuredate
esto fue adaptado del siguiente post:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português