cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SoniaL Member
Member

Relationship between tables

Hi, 

 

I'm having some trouble creating a relationship between 3 tables, which are all related by the column 'metric'. I'd love to link them all so i can then filter/slice by the 'Metric' - Each table has the metrics - PTAT, PEOPLE REACHED & PAGE LIKES 

 

Anyone able to help?

 

Thank you!

Sonia

 

 

 

Capture12.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables

This DAX might help create a table that you can then relate your three existing tables to

 

Table = 
    DISTINCT(
        UNION(
            VALUES('Demo'[METRIC]) ,
            VALUES('Country'[METRIC]) ,
            VALUES('City'[METRIC]) 
            )
      )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

6 REPLIES 6
Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables

HI @SoniaL

 

Does one of the three tables only have unique values for METRIC in it?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

SoniaL Member
Member

Re: Relationship between tables

Hi Richard, 

 

No, they've all got the same three (but different values for each metric) which i think could be the problem! 

 

Is there any way around this?

Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables

Maybe create a new table that has every METRIC value


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Phil_Seamark Super Contributor
Super Contributor

Re: Relationship between tables

This DAX might help create a table that you can then relate your three existing tables to

 

Table = 
    DISTINCT(
        UNION(
            VALUES('Demo'[METRIC]) ,
            VALUES('Country'[METRIC]) ,
            VALUES('City'[METRIC]) 
            )
      )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

SoniaL Member
Member

Re: Relationship between tables

Hi Phil, 

 

That worked! 

 

Thank you so much Smiley Happy 

 

Sonia

SoniaL Member
Member

Re: Relationship between tables

Hi @Phil_Seamark

 

Thanks again for this great tip, I've been using it a lot!

 

Unfortunately, for this latest one, I'm getting a null value in the new table, but I can't work out why... 

 

Any ideas?

 

 

Account Relationship =
DISTINCT(
UNION(
VALUES('HOMEPAGE'[SITE SECTION]) ,
VALUES('HOMEPAGE+FRANCHISE'[SITE SECTION]) ,
VALUES('MARVEL'[SITE SECTION]),values('OTHERS'[SITE SECTION]),values('PIXAR'[SITE SECTION]),values('SHOP ALL'[SITE SECTION]),values('STAR WARS'[SITE SECTION])
)
)

 

Then in my new Table it returns

 

HOMEPAGE

 

HOMEPAGE+FRANCHISE

MARVEL

OTHERS

PIXAR

SHOP ALL

STAR WARS

 

Thanks again

 

Sonia

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: 464 members 4,249 guests
Please welcome our newest community members: