The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Bom dia,
Tenho um Power BI onde possuo as colunas NomAgencia e Login_Ad (atendentes), elas sao texto normal
Tenho as colunas Inicio_Aten, Fim_Atend, Tempo_Atend. Essas Colunas são em horas, minutos e segundos.
Quando tento extrair o tempo médio e soma de atendimento, o Power BI nao extraí corretamente. COm isso não consigo calcular a média e tempo total das lojas e dos atendentes.
Como consigo resolver isso? Quais medidas (códigos) eu consigo fazer?
No excel era fácil.
Solved! Go to Solution.
Hi @Silvio_Carneiro ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a calculated column.
time_min = DATEDIFF('Table'[Start_Attend],'Table'[End_Attend],MINUTE)
(3)We can create measures.
sum of attendance = CALCULATE(DISTINCTCOUNT('Table'[Login_Ad]),FILTER(ALL('Table'),'Table'[NomAgencia]=MAX('Table'[NomAgencia])))
average time (min) =
var _a=CALCULATE(SUM('Table'[time_min]),FILTER(ALL('Table'),'Table'[NomAgencia]=MAX('Table'[NomAgencia])))
return DIVIDE(_a,[sum of attendance],0)
(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Silvio_Carneiro ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a calculated column.
time_min = DATEDIFF('Table'[Start_Attend],'Table'[End_Attend],MINUTE)
(3)We can create measures.
sum of attendance = CALCULATE(DISTINCTCOUNT('Table'[Login_Ad]),FILTER(ALL('Table'),'Table'[NomAgencia]=MAX('Table'[NomAgencia])))
average time (min) =
var _a=CALCULATE(SUM('Table'[time_min]),FILTER(ALL('Table'),'Table'[NomAgencia]=MAX('Table'[NomAgencia])))
return DIVIDE(_a,[sum of attendance],0)
(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |