cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Reincidente

Boa tarde,

Estou precisando de uma ajuda no cálculo abaixo:

Na base em anexo eu preciso calcular o total de reincidente, conforme regras abaixo:

1 - Calcular quantas vezes o cod assinatura se repetiu em, por exemplo, o

Cod Assinatura "24539774" repetiu 3 vez (janeiro, março e maio)

Cod Assinatura "25879994" repetiu 1 vez (maio)

Cod Assinatura "90988234" repetiu 1 vez (janeiro, fevereiro, março e abril)

2 – Se a quantidade de vezes que se repetiu foi maior ou igual a 3 é uma assinatura reincidente.

3 – Quantas assinaturas foram reincidentes, no exemplo acima o meu total é igual a 2.

2 ACCEPTED SOLUTIONS
Community Support

If you want to get the number of "YES" customers in your case, you can refer to my following test
Here is my test data:

I created a couple of measures.

``````M_No_complaints_month =
CALCULATE(DISTINCTCOUNT('Table'[Month_Num]),FILTER(ALL('Table'),'Table'[Cod Assinatura]=MAX('Table'[Cod Assinatura])))``````
``verification = IF([M_No_complaints_month]>=3,"Yes","No")``
``````M_num_of_Yes =
CALCULATE(
DISTINCTCOUNT('Table'[Cod Assinatura]),FILTER(ALL('Table'),[M_No_complaints_month]>=3))``````
``````Total Individual Complaints =
CALCULATE(SUM('Table'[No of complaints]),FILTER(ALL('Table'),'Table'[Cod Assinatura]=MAX('Table'[Cod Assinatura])))
``````

Here is the result:

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

You can share .pbix files to the forum by uploading them to OneDrive!

5 REPLIES 5
Community Support

If you want to get the number of "YES" customers in your case, you can refer to my following test
Here is my test data:

I created a couple of measures.

``````M_No_complaints_month =
CALCULATE(DISTINCTCOUNT('Table'[Month_Num]),FILTER(ALL('Table'),'Table'[Cod Assinatura]=MAX('Table'[Cod Assinatura])))``````
``verification = IF([M_No_complaints_month]>=3,"Yes","No")``
``````M_num_of_Yes =
CALCULATE(
DISTINCTCOUNT('Table'[Cod Assinatura]),FILTER(ALL('Table'),[M_No_complaints_month]>=3))``````
``````Total Individual Complaints =
CALCULATE(SUM('Table'[No of complaints]),FILTER(ALL('Table'),'Table'[Cod Assinatura]=MAX('Table'[Cod Assinatura])))
``````

Here is the result:

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

Oi, Carson Jian. Obrigado pelo retorno.

Utilizei as medidas que voce me enviou mais não esta dando certo.

Estou anexando o arquivo que estou trabalhando para verificar onde estou errando.

Atenciosamente
Sérgio Nogueira

Community Support

This may be due to the fact that the data I tested and your actual data do not match, and the calculation environment is different so that the code I provided does not achieve the correct effect.
You need to re-edit the code according to the field requirements in your actual case and the relationship before the table.
In my test data, the Data Bancas are Data/Time type data, the rest of the data is numeric or text type, but actually this does not affect the overall calculation logic!

Unfortunately, I can't access the workspace report you provided due to my work environment, can you provide the pbix file that doesn't contain sensitive data (with simple test data in between, such as the case scenario you presented before)
Below is a screenshot when I try to access the link you provided:

Please modify the code I provided according to your actual computing environment, if you can provide the corresponding pbix file (without sensitive data) and some data screenshots, it will be very helpful in solving your problem.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

Bom dia, Carson Jian,

Não estou conseguindo anexo o arquivo pbix, só encontrei a opção de anexar o link.

Você pode me ajudar como anexar.

Atenciosamente,

Sérgio Nogueira

Community Support

You can share .pbix files to the forum by uploading them to OneDrive!