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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
KaiRado
Frequent Visitor

Creating relationship between two tables using null calculated columns SSAS

Hi!

 

I'm having a problem of recreating a solution that my previous colleage did and nobody has no idea what the solution really means.
There are two tables in tabular model: a dimension (D) and a fact table (F) which have the same source but each table contains different number of attributes. Each table contains a calculated column "Link" which has no expression:

KaiRado_0-1666820369955.png


These two tables has a relationship (Many to one, Both Directions) using these two calculated columns:

KaiRado_1-1666820608487.png

How does it even work?

Even though I don't understand the logic, I tried to recreate this solution using another two tables, but I'm getting an error: Link column contains a duplicate value null and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table. 

 

Can somebody please explain what is going on and why am I getting an error while trying to recreate almost the same thing that actually works?

 

Thank you in advance!

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @KaiRado 

According to the error message you encountered, you are encountering a problem about data modeling, you have created a many-to-one relationship for two tables in the data model, the link column in dimension table (D) is used as one end column, but the link' column contains duplicate null values, there are two solutions to this error:

The first is to go to Power Query and use filtering to filter out rows in the link column that contain null values and reload them into Power BI

The second is to reconstruct the relationship between the two tables and respecify the primary key associated between the two tables, because as far as I know, if the related primary key between the two tables also contains a null value, it does

It has a certain impact and trouble on data screening and display.

 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @KaiRado 

According to the error message you encountered, you are encountering a problem about data modeling, you have created a many-to-one relationship for two tables in the data model, the link column in dimension table (D) is used as one end column, but the link' column contains duplicate null values, there are two solutions to this error:

The first is to go to Power Query and use filtering to filter out rows in the link column that contain null values and reload them into Power BI

The second is to reconstruct the relationship between the two tables and respecify the primary key associated between the two tables, because as far as I know, if the related primary key between the two tables also contains a null value, it does

It has a certain impact and trouble on data screening and display.

 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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