Skip to main content
cancel
Showing results for 
Search instead 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

Reply
sns1996
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.

Base.jpgCalculo.JPG

2 ACCEPTED SOLUTIONS
v-jtian-msft
Community Support
Community Support

Hi,@sns1996 . I am glad to help you.
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:

vjtianmsft_0-1720576606276.png

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:

vjtianmsft_1-1720576703360.png

 

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.



View solution in original post

Hi,@sns1996 .Thank you for your reply 
You can share .pbix files to the forum by uploading them to OneDrive!

View solution in original post

5 REPLIES 5
v-jtian-msft
Community Support
Community Support

Hi,@sns1996 . I am glad to help you.
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:

vjtianmsft_0-1720576606276.png

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:

vjtianmsft_1-1720576703360.png

 

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.



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.

Desde já agradeço.

Atenciosamente
Sérgio Nogueira

 

https://app.powerbi.com/reportEmbed?reportId=a16e90a3-f38f-46bf-8918-d131f36585c2&autoAuth=true&ctid... 

Hi,@sns1996 .Thank you for your reply.

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:

vjtianmsft_0-1720665436654.png

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.

How to Get Your Question Answered Quickly - Microsoft Fabric Community

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.



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

 

Hi,@sns1996 .Thank you for your reply 
You can share .pbix files to the forum by uploading them to OneDrive!

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.