Forum Discussion
Syndicate_Admin
3 years agoAdministrator
Add 12 mobile months repeating empty data
Hello friends, good afternoon. I have the following problem, I need to generate a staff calculation of 12 mobile months projected until the end of the fiscal year (March 2023) but I have data onl...
- 3 years ago
Hello @Syndicate_Admin Rico Zhou
I already found the solution:
Headcount SSOMA= VAR _SUMMAIRZE = SUMMARIZE ( 'Calendar'; Calendar[Date]. [Year]; Calendar[Date]. [Month]; "HEADCOUNT"; CALCULATE ( [NominaPropios] )) VAR _CIA = SELECTEDVALUE('Compañía'[EmpresaPivote]) var FilterCia= IF(COUNTROWS(FILTERS('Compañía'[EmpresaPivote]))=1; FALSE(); TRUE()) VAR VoF=IF(FilterCia=FALSE();_CIA; TRUE()) VAR _ADD = ADDCOLUMNS ( _SUMMAIRZE; "NewHeadCount"; VAR _DATE = MAXX ( ALL( NominaCons ); NominaCons[Periodo (fecha)] ) VAR _LASTVALUE = CALCULATE ( [NominaPropios]; all('NominaCons'); 'NominaCons'[Periodo (fecha)] = _DATE; 'Compañía'[EmpresaPivote] IN VALUES('Compañía'[EmpresaPivote]); TipoMineria[Tipo] IN VALUES(TipoMineria[Tipo]); TipoNomina[TipoNomina] IN VALUES(TipoNomina[TipoNomina]); BU[UNIDAD_DE_NEGOCIO] IN VALUES(BU[UNIDAD_DE_NEGOCIO]) ) RETURN IF ( ISBLANK ( [HEADCOUNT] ); _LASTVALUE; [HEADCOUNT] ) ) RETURN SUMX ( _ADD; [NewHeadCount] )
Syndicate_Admin
3 years agoAdministrator
Hello @Syndicate_Admin
The solution serves me for the total, but I have a problem when I make a separation by Business Unit
I'll give you the example:
If you notice, in the 2nd column the last real value is 479 and that 479 should be repeated, but the total (2629) is repeated and not that of just that business unit
The same in the column of own, should be repeated 750 and repeat 7245. For the total (the sum of both) 1229 should be repeated but 9874 is repeated.
Please your help, thank you very much.
Syndicate_Admin
3 years agoAdministrator