Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Olá
Preciso de ajuda para criar uma regra que traga a soma de funcionarios ativos mes a mes e ano a ano.
CHAPA = FUNCIONARIO
Preciso de um gráfico que me traga quantos funcionários eu tinha baseado no histórico de cada um.
Por exemplo:
No Mês 4 de 2011 eu tinha: 4 Ativos
A chapa 3 e 2 não entram pois a ultima situação (datamudanca) é "D"
E eu precisaria de um gráfico que trouxesse esses dados mês a Mês
por exemplo: no Mês 1 de 2011 o resultado seria: 3 --- LINHAS 3,5 e 6
O resultado seria este para o exemplo acima:
Solved! Go to Solution.
Hi @lorran
I have a test by your sample. Firstly we need to build a calendar table.
Date =
ADDCOLUMNS (
CALENDAR ( DATE ( 2011, 01, 01 ), DATE ( 2011, 02, 28 ) ),
"Year", YEAR ( [Date] ),
"Month", MONTH ( [Date] ),
"Month-Year", FORMAT ( [Date], "MMM-YY" ),
"YearMonth",
YEAR ( [Date] ) * 100
+ MONTH ( [Date] )
)
Then build a measure to get result.
Measure =
VAR _MaxDate = MAX('Date'[Date])
VAR _T = SUMMARIZE(FILTER(ALL(Sheet3),Sheet3[DATAMUDANICA]<=_MaxDate&&Sheet3[DATAMUDANICA] = CALCULATE(MAX(Sheet3[DATAMUDANICA]),FILTER(ALL(Sheet3),sheet3[CHAPA] =EARLIER(Sheet3[CHAPA])))),Sheet3[CODCOLIGAD],Sheet3[CHAPA],Sheet3[DATAMUDANICA],Sheet3[NOVASITUACA])
RETURN
COUNTAX(FILTER(_T,[NOVASITUACA]<>"D"),[CODCOLIGAD])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sensacional!
Me ajudou perfeitamente, muito obrigado meu amigo.
Hi @lorran
I have a test by your sample. Firstly we need to build a calendar table.
Date =
ADDCOLUMNS (
CALENDAR ( DATE ( 2011, 01, 01 ), DATE ( 2011, 02, 28 ) ),
"Year", YEAR ( [Date] ),
"Month", MONTH ( [Date] ),
"Month-Year", FORMAT ( [Date], "MMM-YY" ),
"YearMonth",
YEAR ( [Date] ) * 100
+ MONTH ( [Date] )
)
Then build a measure to get result.
Measure =
VAR _MaxDate = MAX('Date'[Date])
VAR _T = SUMMARIZE(FILTER(ALL(Sheet3),Sheet3[DATAMUDANICA]<=_MaxDate&&Sheet3[DATAMUDANICA] = CALCULATE(MAX(Sheet3[DATAMUDANICA]),FILTER(ALL(Sheet3),sheet3[CHAPA] =EARLIER(Sheet3[CHAPA])))),Sheet3[CODCOLIGAD],Sheet3[CHAPA],Sheet3[DATAMUDANICA],Sheet3[NOVASITUACA])
RETURN
COUNTAX(FILTER(_T,[NOVASITUACA]<>"D"),[CODCOLIGAD])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.