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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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 @Anonymous ,

 

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



Anonymous
Not applicable

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 @Anonymous ,

 

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



Anonymous
Not applicable

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



Anonymous
Not applicable

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?

Anonymous
Not applicable

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 @Anonymous ,

 

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.