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
Dhjlm
Frequent Visitor

Problem with unique values

I have a table of shipments statistics 'Query 1', and a table with distances from our warehouse based on postnumbers 'Rev 202011'.

I'm trying to create a relationship between the postnumbers ('query1[POSTNR3]) and ('Rev 202011'[Postnr]) to see the distance for each shipment.

That will of course not work beacuse the distance column ('Rev 202011'[Avstånd (km)]) don't have unique values, simply because several posnumbers can have the same distance from our warehose.

Is there a way to work around this?

Dhjlm_0-1607953593593.png

 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @Dhjlm ,

 

In addition to what @Greg_Deckler mentioned in his response, do check if there are NULL values in the columns that you are trying to create relationship on. ('query1[POSTNR3] and 'Rev 202011'[Postnr] in your case)

I have experienced similar error in the past due to the NULL values in the key columns that are used for creating the relationships between two tables.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @Dhjlm ,

 

In addition to what @Greg_Deckler mentioned in his response, do check if there are NULL values in the columns that you are trying to create relationship on. ('query1[POSTNR3] and 'Rev 202011'[Postnr] in your case)

I have experienced similar error in the past due to the NULL values in the key columns that are used for creating the relationships between two tables.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Super User
Super User

@Dhjlm You should be able to create a many-to-many relationship although that is generally not ideal. You can use DISTINCT to get a table of unique values that you could use as a bridge table. But, sample data and such would be very helpful to try to see what you are trying to accomplish. 

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Dhjlm , when you getting this, while creating or when change it to many to one. ?

looking at this screenshot difficult to tell

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.