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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Gabriellogs
Regular Visitor

Junção de datas entre duas tabelas diferentes - Chave primaria Nº PEDIDO

Preciso calcular o periodo entre duas colunas de tabelas diferentes, onde ja tentei com o codigo abaixo, porem não me responde como deveria.

 

Lead Time =
VAR DataRegistroEvento = SELECTEDVALUE(FUSIONTRAK_INT_EVENTOS[DATA_REGISTRO])
VAR DataInclusaoPedido = RELATED(MAD_PEDVENDAITEM[DTAINCLUSAO])
RETURN
    DATEDIFF(DataRegistroEvento, DataInclusaoPedido, DAY)
 
O calculo logico é (Data registro - Data incluão = Tempo de entrega)
 
Agradeço a ajuda
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

RELATED is not something you usually use in a measure.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

View solution in original post

3 REPLIES 3
LuizKoller
Resolver I
Resolver I

Olá Gabriel!

 

 

As duas tabelas se relacionam? Como você está apresendando os dados? Existe contexto, estão em uma tabela? Em uma matriz? Consegue nos fornecer algumas imagens ou prints de seu problema? 

 

 

Pode anonimizar os dados caso sejam confidenciais.

Ola, tudo bem? Consegui resolver o problema, a grande falha foi na conexao entre as chaves das tabelas, foi nescessario fazer uma join no power query, trazendo a coluna de uma tabela para a outra.

 

Obrigado pela atenção, otima semana!

lbendlin
Super User
Super User

RELATED is not something you usually use in a measure.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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