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
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.


@ 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!:
The Definitive Guide to Power Query (M)

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

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.