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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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!:
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.