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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Leandroenzo
New Member

Calculo de tempo no Power BI

Gostaria de saber como faço para calcular o tempo de um veículo estacionado:

Coluna 1 = entrada do carro

Coluna 2 = saída do carro 

Coluna 3 = subtração da coluna 2 - coluna 1

E se caso o veículo ainda estivesse estacionado calculasse o AGORA-Coluna 1

 

Acredito que seja um "IF", alguém consegue me ajudar na fórmula para o Power Bi

 

 

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Leandroenzo ,

 

Try this as a new custom column in Power Query:

if [Column2] = null then DateTime.LocalNow() - [Column1]
else [Column2] - [Column1]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Preciso de um resultado para a sequinte condição:

 

Requisição Coluna 1     Data Coluna 2           Coluna 3 Status Antigo            Coluna 4 Status Novo         Coluna 4 Resultado em dia ?

00001                           10/11/2023 =>          Entrada em compras                Alteração de Escopo             0

00001                            11/11/2023=>          Alteração de Escopo                Validação de Valor                 1

 

Preciso do resultado na Coluna 4 com a contagem em dias por etapa, mas considerando cada requisição. Se entrar a requisição 00002, inicia uma nova contagem .

 

Grato!

BA_Pete
Super User
Super User

Hi @Leandroenzo ,

 

Try this as a new custom column in Power Query:

if [Column2] = null then DateTime.LocalNow() - [Column1]
else [Column2] - [Column1]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors