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

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.

Reply
irnm8dn
Post Prodigy
Post Prodigy

Understanding the logic in a DAX Statement, and which table to create the column - DAX Wizards Help!

A few weeks ago someone in the forum was gracious enough to help me use and apply a "Related" function allowing me to compare two columns, from two different tables.  What I don't understand is why DAX statement works in a specific sequence. 

 

For instance:

 

Table A = A table of names that I know to be correct

Table B = A table of names that I know some to be correct, others not.

 

I want to compare Table A with Table B and used a DAX statement like this:

 

Match = If(Table B[Name] = Related(Table A[Name]), TRUE(), FALSE() )

 

What I don't understand is why PBI would not accept:

 

Match = If(Table A[Name] = Related(Table B[Name]), TRUE(), FALSE() )

 

It seemed more logical to me to use the latter because I know Table A to be the correct and the table to which I want to compare the information.  Perhaps I am understanding the operation incorrectly?

 

Also, PBI seems sensitive to which of the two tables I create the column in, and would like to undertsand why and what controls this.

 

 

 

8 REPLIES 8
LivioLanzo
Solution Sage
Solution Sage

Hi @irnm8dn

What does the relationship linking TableA and TableB look like?

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

The relationship is based on a Campaign Name.  Table A had a unique instance of the Campaign Name and the customer it belongs to, Table B has the Campaign Name and Customer Name has repeating rows because it includes "daily" performance information.

 

The goal of the comparison is to basically identify Customer Names in Table B that do not match Customer Names in Table A where the Campaign Name is the same.

Just looked, thanks.

 

Can you help me understand it a little more?  For instance, help me with the steps that would address this logic in a DAX statement.

 

If my table relationships were joined by Campaingn Name.

 

The customer name in Table A is the same as the Customer Name in Table B, AND the Campaign Name is the Same, True, else False.

 

Keeping in mind that Table A has unique rows of Campaign Name and Customer Name, Table B has uno-unique rows of this information.

 

Thanks!

@irnm8dn

Would you be table to post a sample data? And also, I am assuming you want to add a calculated column? 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Links to sample data below.

 

Table A - represent the correct information what we regard as "True"

 

Table B - represents correct AND incorrect information non unique information

 

The goal is to relate the two tables by Campaign Name, and identify where the customers names represented in Table B are not consistant with what is in Table A.  The end result would  allow us to update the Customer Name in the "system of record" where the informaiton in Table B is found.

 

A PBI table would show 4 columns.  Every instance of the Campaign Name (from Table B) would be displayed in a PBI table. 

 

Campaign Name (from Table B) | Customer Name (from Table A) | Customer Name from (Table B ) | True/False Customer Name in Table A Matches Customer Name in Table B

 

 

Thanks for your help.

Hi @irnm8dn,

 

As the picture, If you create a related column in Table A, there are more than one values will be returned. It is not possbile obviously.

 

 

related.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Not sure I understand your response.  The table on the right is kind of what I am looking for, so two questions:

 

1.  Did Campaign Name come from Table A or Table B in the graphic on the right?

2.  What is a reasonable DAX expression to compare the column vaule called Customer Name which appears in both tables.

 

Thanks.

RELATED does not flow from the one side table to the many side table so you can only use it in Table B.

You should take a look at RELATEDTABLE 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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