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.
Excel ExemploOlá, estou com uma pequena dúvida em relação a média de duração de uma certa atividade em diferentes empresa.
Hi guys, I'm having trouble in doing an average of an activity in a different company.
Exemplo:
Example:
Essa é uma tabela de exemplo, empresa A B e C com data inicio tarefa e fim da tarefa.
Example table, company A B and C with task start date and task end.
transformei essa esse tempo inicio - tempo fim em duração com essa fórmula Query
Transform start date - end date into duration.
Duration.ToText([Data Fim] - [Data Incio])
Coloquei uma coluna pra ficar facil visualizar a data formatada com essa formula em DAX
Create new Column to customize the date format.
Duracao Amigavel = IF ( LEFT ( Planilha1[Duracao]; IFERROR ( SEARCH ( "."; Planilha1[Duracao] ); 1 ) - 1 ) = ""; 0; LEFT ( Planilha1[Duracao]; IFERROR ( SEARCH ( "."; Planilha1[Duracao] ); 1 ) - 1 ) ) & " Dias " & RIGHT ( Planilha1[Duracao]; 8 )
Oq eu quero fazer é um gráfico de pizza com a empresa de acordo com o tempo médio gasto. Quanto maior a fatia da empresa, mais tempo ela gastou nessa atividade e um cartão que mostra-se a média dessa empresa
I want in the end a pie chart with the average duration of each company.
Exemplo:
Exemple:
Solved! Go to Solution.
Hi @Antonio_Flávio,
Utilizando a mesma formula da coluna calculada cria a seguinte seguinte medida e coloca nas tooltips do grafico ou cria uma nova página de tooltip.
Using the same formula as your calculated column create the follwoning measure and add it add it to the tooltips of the visual or create a new tooltip page.
Duracao Média = IF ( LEFT ( [AVerage]; IFERROR ( SEARCH ( "."; [AVerage] ); 1 ) - 1 ) = ""; 0; LEFT ([AVerage]; IFERROR ( SEARCH ( "."; [AVerage] ); 1 ) - 1 ) ) & " Dias " & RIGHT ( [AVerage]; 2 )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Antonio_Flávio,
O problema na visualização é que ao fazer a coluna Duração amigvel como texto ao colocar no pie chart ele faz a contagem dos textos e não a média dos valores necessita de utilizar para o grafico a coluna Duracao e não Duracao amigavel.
The issue with the visualization is that when you do the Duracao amigavel as a text placing it on the pie chart it will count the number of text and not the average you need to do your pie chart with Duracao column and not Duracao amigavel.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMas o valores ficam em decimal e não é algo visual para tomar um decisão
Yes but not something visual would like in the format Day HH: MM: SS.
Hi @Antonio_Flávio,
Utilizando a mesma formula da coluna calculada cria a seguinte seguinte medida e coloca nas tooltips do grafico ou cria uma nova página de tooltip.
Using the same formula as your calculated column create the follwoning measure and add it add it to the tooltips of the visual or create a new tooltip page.
Duracao Média = IF ( LEFT ( [AVerage]; IFERROR ( SEARCH ( "."; [AVerage] ); 1 ) - 1 ) = ""; 0; LEFT ([AVerage]; IFERROR ( SEARCH ( "."; [AVerage] ); 1 ) - 1 ) ) & " Dias " & RIGHT ( [AVerage]; 2 )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
Peço desculpa, altere a formula para o seguinte:
Duracao Média = VAR Average_Duration = AVERAGE ( Planilha[Duracao] ) RETURN IF ( LEFT ( Average_Duration; IFERROR ( SEARCH ( "."; Average_Duration ); 1 ) - 1 ) = ""; 0; LEFT ( Average_Duration; IFERROR ( SEARCH ( "."; Average_Duration ); 1 ) - 1 ) ) & " Dias " & RIGHT ( Average_Duration; 2 )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
No meu ficheiro funciona OK, apesar de ter menos dados que vc.
Pode partilhar uma cópia do PBIX para ver os detalhes?
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIt's asking me a permission can you make it open?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsNão estou conseguindo baxiar a base, eu estou com dificuldades ao realizar a média. Até a separação das empresas e o total de dias está OK.
Muito bom o tutorial !!
@MFelix Eu não sei como colocar o arquivo aqui então coloquei no dropbox espero que consiga.
Penso que seja relacionado com o seu formato de dados.
Porque tem a seguinte coluna no seu código do power query
= Table.TransformColumns(#"Personalização Adicionada", {{"Duracao", each Text.Start(_, 10), type text}})
Parece que está a extrair texto?
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@MFelix Você resolveu, o problema é a pelo idioma. no meu trabalho o power BI está inglês estão consigo trabalho com valores decimais com "." .Na minha casa trabalho com o power bi português então as casas decimais são separadas por ",".
Correção:
Power BI Português - Decimais por ,
Duracao Média = VAR Average_Duration = AVERAGE ( Planilha1[Duracao] ) RETURN IF ( LEFT ( Average_Duration; IFERROR ( SEARCH ( ","; Average_Duration ); 1 ) - 1 ) = ""; 0; LEFT ( Average_Duration; IFERROR ( SEARCH ( ","; Average_Duration ); 1 ) - 1 ) ) & " Dias " & RIGHT ( Average_Duration; 2 )
Power BI Inglês - Decimais por .
Duracao Média = VAR Average_Duration = AVERAGE ( Planilha1[Duracao] ) RETURN IF ( LEFT ( Average_Duration; IFERROR ( SEARCH ( "."; Average_Duration ); 1 ) - 1 ) = ""; 0; LEFT ( Average_Duration; IFERROR ( SEARCH ( "."; Average_Duration ); 1 ) - 1 ) ) & " Dias " & RIGHT ( Average_Duration; 2 )
Ainda bem que tem tudo a funcionar correctamente.
Alguma questão adicional é só dizer.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@MFelix poderia me explicar, como criar e utilizar esse PAGE2, pois quero esconder um dado igual você fez com esse PAGE2
Hi @Antonio_Flávio,
Basicamente o que criamos é uma pagina com os gráficos que queremos e que de acordo com o contexto do grafico faz a filtragem dos dados.
Verifique a ligação para uma explicação mais pormenorizada.
Tem de ter a ultima versão do Power BI.
Se tiver alguma questão adicional é só dizer.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |