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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
finnprice
Regular Visitor

One-to-Many Relationship with Null Value

Hello All,

 

I hope you are well!

 

I am looking to create a one-to-many link between two tables (Mastertable and Project_Table) based on a column entitled "Project Code."

 

Mastertable has the project code as well as other information on the project such as opportunity name, contact, lead source, type of project, etc. Mastertable does not contain any financial data.

 

Project_Table on the other hand only has three columns, the opportunity name, the project code and the opportunity amount.

 

My goal is to link the financial data to my Mastertable using a a one-to-many match based on the project code. However, not every opportunity is assigned a project code at the same time. So, my Project_Table has multiple null values under the project code column because of timing differences. As I try to create the link between tables, I am running into an error where the project_table "contains a duplicate value 'Null'." Is there a way to have the one-to-many link ignore rows with nulls in the project code column or do I need to clean the data better at the source?

 

Any tips/suggestions are welcome! Thanks in advance 🙂

 

P.S. data is confidential so I can't provide any datasets but can answer any questions if the two table setup isn't clear.

 

1 ACCEPTED SOLUTION
pankajnamekar25
Super User
Super User

Hello @finnprice 

 

 Go to Project_Table in Power Query Editor.

 Add a step to filter out rows where Project Code is null:

powerquery

Table.SelectRows(Project_Table, each [Project Code] <> null)

 

or

via UI

Click the dropdown on Project Code column

Uncheck (null)

 Apply and Close → Now the relationship will create without error

 

Thanks,
 Pankaj Namekar | LinkedIn

View solution in original post

2 REPLIES 2
pankajnamekar25
Super User
Super User

Hello @finnprice 

 

 Go to Project_Table in Power Query Editor.

 Add a step to filter out rows where Project Code is null:

powerquery

Table.SelectRows(Project_Table, each [Project Code] <> null)

 

or

via UI

Click the dropdown on Project Code column

Uncheck (null)

 Apply and Close → Now the relationship will create without error

 

Thanks,
 Pankaj Namekar | LinkedIn

Ashish_Excel
Super User
Super User

Hi,

In Power Query, filter the project code column to remove all blanks/nulls.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.