cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mr_guedes Regular Visitor
Regular Visitor

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
Moderator v-yuezhe-msft
Moderator

Re: Merging a set o tables

@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.
mr_guedes Regular Visitor
Regular Visitor

Re: Merging a set o tables


@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

mr_guedes Regular Visitor
Regular Visitor

Re: Merging a set o tables

@v-yuezhe-msft;

 

Did you get to see the file?

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 84 members 2,729 guests
Please welcome our newest community members: