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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
PshemekFLK
Helper IV
Helper IV

Two columns with same fields but relationship doesn't work

I have two tables to which I've added a merged column using Power Query "Merged Column" option. Both columns have the same fields and I am able to create a relationship. However the relationship doesn't work. PowerBI doesn't recognize that those are the same fields (I know because I've tried to look them up using LOOKUPVALUE but it returns empty cells). I've tried trimming in power query but doesn't help. Anyone knows what may be happening?

 

One column in plan fact table:

 

PshemekFLK_0-1610396874566.png

 

The other one in dim_calendar table:

 

PshemekFLK_1-1610396981880.png

 

Thanks!

 

 

1 ACCEPTED SOLUTION

@PshemekFLK 

The problem is that the fields do not match:

error in fields.JPG

 

Changing the field in the calendar table (YearMonth)

solution.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

11 REPLIES 11
PaulDBrown
Community Champion
Community Champion

@PshemekFLK 

Sorry, this may sound obvious, but are you sure the relationship links both columns (and not some other field?)

If so, it might be worth trimming and cleaning both columns just in case





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Gabriel_Walkman
Continued Contributor
Continued Contributor

How does the relationship not work? Can you create the relationship without problems, or do you get errors?

 

What column are you using for merging on the two tables? Could there be a way for all this without merging anything, just using relationships?

 

It seems strange to me that your plan fact has those months as a column (instead of just a date), but I can't put my finger on it without seeing the system as a whole.

I can create a relationship with no issues and it is active.

 

The reason why I'm merging is that the plan is created on the month granularity while all other fact tables are on the date granularity. If I create a relationship based on the year field the split by month doesn't work and if I create a relationship based on the month field the split by year doesn't work. Hence I'm creating a merged year + month.

PaulDBrown
Community Champion
Community Champion

@PshemekFLK 

Try creating a table visual with both columns and see if the rows match





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Here's what I got in the visual. Blanks from dim_calendar field:

 

PshemekFLK_0-1610398211354.png

 

 

@PshemekFLK 

I take it  the relationship is one-to-many from the dim calendar down to the fact table. If so, you need to make the calendar table column  the parent in the matrix (or use a Table visual instead)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






No matter how I put in the table, dim_calendar field shows blanks:

PshemekFLK_0-1610399136532.png

PshemekFLK_1-1610399158088.png

 

 

 

Below the link to the pbix file with the source files included where I carved out the data that causes the issue. Relationship is connecting the right fields. I didn't do trimming in this file but I tried in the original one and didn't help. 

 

FILE 

@PshemekFLK 

The problem is that the fields do not match:

error in fields.JPG

 

Changing the field in the calendar table (YearMonth)

solution.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Wow, this is embarassing. I checked this multiple times and didn't notice. I must have been fooled by the order of columns when merging while it is order of selecting them that matters. Sorry for bothering and thanks for clarifying. 

@PshemekFLK 

No probs. Most of us have been through that! And a fresh pair of eyes normally helps (a bit like proof-reading)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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