Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Necessito de ajuda, neste exemplo a coluna "NovaColuna" deveria calcular a media mesal porem o resultado é igual para todos os meses. Eu espearava que ele calculasse a media mes a mes do campo SLA_DEMANDA_HRS, porem no reslutado ve todos os valores iguais.
Lembrando que todos os dados estão em uma unica tabela(Base_Demandas_CRM). e desta tabela estou criando outra Tabela_Sumarizada.
Abaixo a imagem do resultado:
E como fiz no excel : =SEERRO(MÉDIASES(Base_Demandas_CRM[SLA_DEMANDAS_HORAS];Base_Demandas_CRM[MESABERTURA];A2;Base_Demandas_CRM[ENCERRADA];"N";Base_Demandas_CRM[CODPROCESSO];78);"")
Solved! Go to Solution.
The issue caused by this row:
In the table view, MAX() can not be used to extract the current value, instead of, you can use earlier() to filter the row:
Plz try this:
Tabela_Sumarizada =
ADDCOLUMNS (
SUMMARIZECOLUMNS (
Base_Demandas_CRM[DTAberturaDemandaREF],
-- Mês da data de abertura
"DemandasAbertas",
CALCULATE (
COUNTROWS ( Base_Demandas_CRM ),
Base_Demandas_CRM[CODPROCESSO] = 78
),
-- Contagem de demandas abertas com CODPROCESSO = 78
"DemandasEncerradas",
CALCULATE (
COUNTROWS ( Base_Demandas_CRM ),
Base_Demandas_CRM[CODPROCESSO] = 78,
Base_Demandas_CRM[ENCERRADA] = "S"
) -- Contagem de demandas encerradas com CODPROCESSO = 78 e ENCERRADA = "S"
),
"Diferenca", [DemandasAbertas] - [DemandasEncerradas],
"NovaColuna",
IFERROR (
AVERAGEX (
FILTER (
Base_Demandas_CRM,
Base_Demandas_CRM[ENCERRADA] = "N"
&& Base_Demandas_CRM[CODPROCESSO] = 78
&& Base_Demandas_CRM[DTAberturaDemandaREF]
= EARLIER ( Base_Demandas_CRM[DTAberturaDemandaREF] )
),
Base_Demandas_CRM[SLA_DEMANDA_HRS]
),
BLANK ()
)
)
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The issue caused by this row:
In the table view, MAX() can not be used to extract the current value, instead of, you can use earlier() to filter the row:
Plz try this:
Tabela_Sumarizada =
ADDCOLUMNS (
SUMMARIZECOLUMNS (
Base_Demandas_CRM[DTAberturaDemandaREF],
-- Mês da data de abertura
"DemandasAbertas",
CALCULATE (
COUNTROWS ( Base_Demandas_CRM ),
Base_Demandas_CRM[CODPROCESSO] = 78
),
-- Contagem de demandas abertas com CODPROCESSO = 78
"DemandasEncerradas",
CALCULATE (
COUNTROWS ( Base_Demandas_CRM ),
Base_Demandas_CRM[CODPROCESSO] = 78,
Base_Demandas_CRM[ENCERRADA] = "S"
) -- Contagem de demandas encerradas com CODPROCESSO = 78 e ENCERRADA = "S"
),
"Diferenca", [DemandasAbertas] - [DemandasEncerradas],
"NovaColuna",
IFERROR (
AVERAGEX (
FILTER (
Base_Demandas_CRM,
Base_Demandas_CRM[ENCERRADA] = "N"
&& Base_Demandas_CRM[CODPROCESSO] = 78
&& Base_Demandas_CRM[DTAberturaDemandaREF]
= EARLIER ( Base_Demandas_CRM[DTAberturaDemandaREF] )
),
Base_Demandas_CRM[SLA_DEMANDA_HRS]
),
BLANK ()
)
)
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.