Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Tenho uma passa de dados onde cada linha é uma infração cometida por um motorista.
Essas infrações elas passam por um operador que faz a validação se essa infração é válida ou não. O que acontece, eu queria montar um gráfico onde mostra o % de infrações tratadas por cada operador.
eu faço o calculo do percentual (Divido o total tratado pelo total de infrações), dai eu coloco o nome dos operadores como eixo e o valor, porém o que ocorre é que o gráfico distribui o mesmo % para todos os operadores, ficando todos os operadores com 20%, onde na verdade eu queria que operador A ficasse com 15%, operador B 3% e o C 2%, por exemplo.
E esse % precisaria ser em cima do total tratado com relação ao total de infrações. ex:
Esse é o cenário que eu preciso:
tenho 100 infrações, dessas 20 foram validadas (20% das infrações foram tratadas)
forem desses 20% operador A tratou 12%, operador B tratou 5% e operador C tratou 3%.
Uma alternativa que encontrei foi montar uma tabela auxiliar onde eu tenho o Operador, o total de infrações geral, o total de infrações validadas geral, o total de infrações validadas pelo operador e ai eu consigo calcular esse % tratado por operador com relação ao total de infrações tratadas, porem essa alternativa faz com que eu perca a interação do gráfico com os filtros pois estou tratando isso numa tabela apenas com o nome dos operadores.
existe alguma forma de fazer esse calculo sem ser por essa tabela auxiliar pra que eu possa retornar a interação do gráfico com os demais filtros do relatório? pois da forma como cheguei nem o filtro de periodo eu consigo aplicar.
Solved! Go to Solution.
Hi @DDalmas ,
Created some data:
Here are the steps you can follow:
1. Create measure.
Total:
sumtotal = COUNTX(ALL('Table'),'Table'[Operator])
Total number of violations:
sumYes = COUNTAX(FILTER(ALL('Table'),'Table'[Violation]="Yes"),'Table'[Violation])
Total after violation group:
group = CALCULATE(COUNT('Table'[Violation]),FILTER(ALL('Table'),'Table'[Violation]="Yes"&&'Table'[Operator]=MAX('Table'[Operator])))
The total number of violations as a percentage of the total:
sum/total = DIVIDE([sumYes],[sumtotal])
Proportion of the total number after the violation group to the total number of violations:
sum/groupo = DIVIDE([group],[sumYes])
2. Result:
When no slicer is selected:
After selecting the slicer:
If this result does not meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DDalmas ,
Created some data:
Here are the steps you can follow:
1. Create measure.
Total:
sumtotal = COUNTX(ALL('Table'),'Table'[Operator])
Total number of violations:
sumYes = COUNTAX(FILTER(ALL('Table'),'Table'[Violation]="Yes"),'Table'[Violation])
Total after violation group:
group = CALCULATE(COUNT('Table'[Violation]),FILTER(ALL('Table'),'Table'[Violation]="Yes"&&'Table'[Operator]=MAX('Table'[Operator])))
The total number of violations as a percentage of the total:
sum/total = DIVIDE([sumYes],[sumtotal])
Proportion of the total number after the violation group to the total number of violations:
sum/groupo = DIVIDE([group],[sumYes])
2. Result:
When no slicer is selected:
After selecting the slicer:
If this result does not meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |