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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mr_guedes
Helper I
Helper I

Merging a set o tables

Hello everyone,

 

I am having trouble when trying to merge data from 4 different tables into one.

 

Here is what I have (the relationships between the tables are stablished by the columns with different colors):

 

 

 

What I need is to create one single table with the following columns:

 

- Data;

- Nome da Conta;

- Saldo SAP;

- Saldo Bancos

 

I'm trying to use the following sentence:

 

Table = SELECTCOLUMNS(JDT1;"Data";RELATED('Calendário'[Data]);"Nome da Conta";RELATED('Plano de Contas'[Nome da Conta]);"Saldo SAP";'JDT1'[Saldo SAP];"Saldo Bancos";LOOKUPVALUE('Extrato Bancário'[Saldo Bancos];'Calendário'[Data];RELATED('Calendário'[Data])))

 

But I always get an error message. Can you guys help me? What am I doing wrong?

 

Thanks in advance!

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@mr_guedes,

You have many-to-many relationship between JDT1 table and Extrato Bancário table, please check if the following DAX returns your expected result, if not, please share sample data of your tables for us to analyze.

Table = SELECTCOLUMNS(JDT1;"Data";RELATED('Calendário'[Data]);"Nome da Conta";RELATED('Plano de Contas'[Nome da Conta]);"Saldo SAP";'JDT1'[Saldo SAP];"Saldo Bancos";CALCULATE(MAX('Extrato Bancário'[Saldo Bancos]);FILTER('Calendário';COUNTROWS(JDT1)>0)))



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


@v-yuezhe-msft wrote:

@mr_guedes,

You have many-to-many relationship between JDT1 table and Extrato Bancário table, please check if the following DAX returns your expected result, if not, please share sample data of your tables for us to analyze.

Table = SELECTCOLUMNS(JDT1;"Data";RELATED('Calendário'[Data]);"Nome da Conta";RELATED('Plano de Contas'[Nome da Conta]);"Saldo SAP";'JDT1'[Saldo SAP];"Saldo Bancos";CALCULATE(MAX('Extrato Bancário'[Saldo Bancos]);FILTER('Calendário';COUNTROWS(JDT1)>0)))



Regards,
Lydia


Lydia,

 

I tried as you told me, but it's showing one single value to the whole column. I need to see the value at the closing of the day.

As you requested, I sent the Pbi file:

 

PBi File

@v-yuezhe-msft;

 

Did you get to see the file?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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