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
Anonymous
Not applicable

2 Table Joins to a single table

Hi,  I have 2 tables that both need to be joined onto a DATE table , but not sure how I best do this. 

 

Table (Mort_Data)   
Variable (Mort_Year)   
Measure (Mort_Vol)

Table (Comp_Data)
Variable (Comp_Year) 
Measure (Comp_Vol)

Table (Date_Table)   
Variable (Date_Year)

 

I need to essentially have the design like below (open to suggestions though, of course).

Brandon16_3-1635090435324.png

The reason for needing this (I think, unless there is a better, easier way) is that one bar chart I need will require the X-axis to have the Year, but it will be the combimation of the COMP_YEAR and MORT_YEAR as I will have 2 values (Mort_Vol and Comp_Vol). This is the output that I am hoping to achieve in Power BI (taken from a mock in excel) and maybe it can be done another way?

Brandon16_2-1635090392107.png

 

I hope that all makes sense, any help on this would be hugely appreciated. 

 

 

1 ACCEPTED SOLUTION

Yes, the common axis / filtering is done via the Date_Table.

From both tables you get the corresponding aggregated value.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

11 REPLIES 11

Hi @Anonymous ,

 

looks okay to me.

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

The problem is, I can't seem to join the 2 tables to the Date_Table, it won't allow me to have 2 active joins for some reason. I get this error message that I have no idea how to resolve. 

"an active set of indirect relationships already exists between these tables. To make this relationship active, set the Cross filter to "Single", delete, or deactivate any indirect relationship first"

Hi @Anonymous ,

 

can you provide a screenshot of the model view?

 

Check that the relations are one to many (1:*) as in your drawing and that the filter direction points only to the fact tables Mort_Table and Comp_Table.

 

Also make sure that there is no other direct relationship between the Mort_Table and Comp_Table tables.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

This is the model, as you can there is a solid line between MORT_TABLE and DATE_Table, but a dotted line between COMP_TABLE and DATE_TABLE and I can't seem to make this active. 

Brandon16_0-1635097923295.png

 

Hi @Anonymous ,

 

the problem is the direct relationship between MORT_TABLE and COMP_TABLE.

Can you remove this?

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

I do need those tables joined together, sadly. Unless there is another way to do this, but doubt there will be. 

Hi @Anonymous 

What is this many-to-many relationship for?

 

2021-10-24 20_19_23-Brandon16_0-1635097923295.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

I needed the 2 volumes that come from those tables so assumed that I needed that join. If I was to remove it, would that data model allow me to pull back the variables needed as stated above?

Yes, the common axis / filtering is done via the Date_Table.

From both tables you get the corresponding aggregated value.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

Yes, that make sense. I have just removed this and I do get the data I need, thank you.

However, by removing this, it now impacts another table because the join has disappeared. It's like one issue is resolved, but causes another issue elsewhere. 

I need my table to have data from the following tables
Dept_Table,
Sales,
Mort_Table
and Comp_Table

but now the join has been removed, I only have data from these tables
Dept_Table,
Sales,
and Mort_Table

as it won't allow me to bring in data from Comp_Table. Do I need to restructure the model somehow to capture?

Yes, the best way to structure your data model is as a star schema
https://docs.microsoft.com/en-us/power-bi/guidance/star-schema

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


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.