Tag Archives: Power BI

Power BI – The cardinality you selected isn’t valid for this relationship

This can be a real hair-puller, especially when the relationship really is 1:1. Ensure you have done the following to the matching keys:
* Convert the keys to UPPER or lower. Power BI doesn’t consider the same string in upper and lower case to be the same.
* Remove blanks/nulls
* Remove duplicates (of course)
* Remove errors

Power BI – How To Make Calculated Columns in a Related Table for Rows that Don’t Exist in the Other Table

Scenario: Table A contained values that did not exist in Table B. Nevertheless, I wanted to use a Boolean calculation on those values. I was frustrated for several hours until I realised that what I really needed to do was create the column in Table A, and use the RELATED keyword.

Original Query (Table B on the right side):

GoodVersion = SWITCH(TRUE(), ISBLANK(Query2[First Seen]), FALSE(), DATEDIFF(Query2[First Seen],UTCTODAY(),DAY) <= 90, TRUE(), FALSE(), FALSE())

Result:

Fixed Query (Table A on the left side):

GoodVersion = SWITCH(TRUE(), ISBLANK(RELATED(Query2[First Seen])), FALSE(), DATEDIFF(RELATED(Query2[First Seen]),UTCTODAY(),DAY) <= 90, TRUE(), FALSE(), FALSE())

Result: