Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Silvio_Carneiro
Frequent Visitor

Calcular tempo total e media de atendimento por loja e por atendente

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.

Silvio_Carneiro_0-1692191002665.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Silvio_Carneiro ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1692255620329.png

(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.

vtangjiemsft_1-1692255727327.png

 

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. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Silvio_Carneiro ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1692255620329.png

(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.

vtangjiemsft_1-1692255727327.png

 

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. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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