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
Samyz
Regular Visitor

The cardinality you selected isn't valid for this relationship (1:*)

Hello,

I am trying to create relationships between tables based on a custom index. And get the message in the screenshot below.

I have already tried: clearing my cashe, switching between (1:*) and (*:1) relationships, switching the filter direction between single and both. 

Samyz_1-1712051329277.png

There can't be duplicates in any of the tables. 

The tables contain data of this form: 

Samyz_2-1712051693704.png

 

I'd be happy to hear your recommendations!

 

8 REPLIES 8
MFelix
Super User
Super User

Hi @Samyz ,

 

First of all confirm that in those columns you don't have duplicated values that can be checked on the table view clicking on the column at the bottom left it refers how many values you have.

 

Also one thing that ussually give errors on the relationships is having blanks or null values on your columns.

 

Based on your screenshots it does not seem that you have it but only seeing a small part of the data.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Here is the situation in two tables that I want to create a relationship for.

There are 16 entires (one for each period), with the same combination of (ltpa_sv, site_id, comb_index) in the second table. I expected this to be the exact situation where a (1:*) relationship comes in. There are always 16 objects in the second table that share the same object in the first table. Is my thinking somehow wrong here? 

Samyz_0-1712140137496.png

 

Hi @Samyz ,

 

If you have 16 entries for each period the you don't have unique values for each period you have many values for each period because the ID must be unique by row not by periods.

 

For this I advise you to create a bridge table with the unique values (the 16 you refer) and then make a relationship from that table to the other two.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I am already using a table with unique period values as you recomended.

In table 1 (which has the keys (ltpa_sv, site_id, comb_id, period) followed bycolumns with relevant values. 

In table2 I isolated the unique combinations of ltpa_sv, site_id, comb_id). This second table is supposed to act as a bridge between all tables that use the comb_id. I want to add things like the probability that a combination is realized there. From this I want to to calculate Expected values of the values in table 1 by comb_id.

This is why I want to connect the two tables. 

I know you have created the measures for the countrows if you can do me a favour and for the table 2 (the one that is bridge) 

 

Can you place the combid column on a table visualization and then the countrows measure in the same visualization and see if everything returns 1.

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I forgot to mention that I'm getting both tables from an sql server database in direct query mode. 

From how they are generated I am sure that there are no duplicates or Null values  in the columns relevant for this relationship. 

Do you require more info to help here? What should I provide you?

Samyz
Regular Visitor

To describe what the contents of my tables are: 

one has multiple datasets for each combination of (model_parameters_id, site_id, comb_id):

for each period there is one entry for each scenario (apva_sv) that belongs to a scenario combination (comb_id): 

Samyz_0-1712061733944.png

The other table is a view that is created based on the here present data. It returns all distinct combinations of  (model_parameters_id, site_id, comb_id). 

Hi @Samyz ,

 

Since you are in DQ mode you must try to do some test with measures, try the following:

  • Add a measure for each table that count the number of rows something similar to:
Count = COUNTROWS(Table1)
  • Add the multi index column form one table and the countrows and check if all the values are equal to 1 and if you do not have any blanks with a number of rows

I know that you refer that you are sure that this does not happen but never hurts to double check.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.