Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hola comunidad,
Necesito ayuda para corregir mi fórmula de dax. Mi ending_hc funciona como se esperaba, pero mi starting_hc no. A continuación encontrará una tabla con los detalles.
Ending_HC =
CALCULAR(
COUNTROWS('Informe de recuento'),FILTER('Informe de recuento',
'Informe de personal'[AÑO ] = SELECTEDVALUE('Informe de recuento de personal'[AÑO ]) &&
'Informe de personal'[MONTH#] = SELECTEDVALUE('Informe de personal'[MONTH#])
))
HC inicial =
VAR _CurrentYear = SELECTEDVALUE('Informe de recuento'[AÑO ])
VAR _CurrentMonth = SELECTEDVALUE('Informe de recuento de personal'[MONTH#])
VAR _PreviousMonth = SI(_CurrentMonth = 1, 12, _CurrentMonth-1)
VAR _PreviousYear = IF(_CurrentMonth = 1, _CurrentYear-1, _CurrentYear)
var edhc = CALCULAR(
COUNTROWS('Informe de recuento'),FILTER('Informe de recuento',
'Informe de personal'[AÑO ] = _PreviousYear &&
'Informe de personal'[MONTH#] = _PreviousMonth
))
DEVOLUCIÓN
IF(_CurrentYear=2021 && _CurrentMonth=2,[Starting_HC],edhc)
Mi salida -
@Ritaf1983
Saludos cordiales
Solved! Go to Solution.
Encontré la respuesta,
Encontré la respuesta,
Pruebe esta medida refinada y aplíquele su lógica:
Starting_HC =
VAR _CurrentYear = SELECTEDVALUE('Informe de recuento'[AÑO ])
VAR _CurrentMonth = SELECTEDVALUE('Informe de recuento de personal'[MONTH#])
VAR _PreviousMonth = SI(_CurrentMonth = 1, 12, _CurrentMonth - 1)
VAR _PreviousYear = IF(_CurrentMonth = 1, _CurrentYear - 1, _CurrentYear)
VAR _StartingHC =
CALCULAR(
COUNTROWS('Informe de recuento de personal'),
FILTRO(
«Informe de plantilla»,
'Informe de personal'[AÑO ] = _PreviousYear &&
'Informe de personal'[MONTH#] = _PreviousMonth
)
)
DEVOLUCIÓN
SI(
ISBLANK(_StartingHC),
0,
_StartingHC
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.