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
Prodan
Frequent Visitor

Suspected referential integrity issue

Hi all,

 

I created a new SQL dabatase from scratch with two tables, sales and product, along with its corresponding relationship. There're no referential integrity violation between these tables whatsoever.

Prodan_0-1596550065922.png

 

If I import this database into Power BI desktop using direct query mode and evaluate the product table with VALUES function, it returns an extra blank row. Based on the official documentation, VALUES only returns an extra blank value when a referential integrity violation is present, however, this is not the case. The issue can also be reproduced using the slicer visualization, which executes a VALUES function in the background.

 

Prodan_1-1596550110604.png

Prodan_2-1596550154124.png

 

The only way I found to fix this was to select the "Assume referential integrity" option when setting up the relationship between the tables in Power BI Desktop. Switching to import mode also fixes the issue. As far as I know, these configurations have nothing to do with fixing referential integrity issues but they solved my problem somehow.

Any ideas on why this is happening?

4 REPLIES 4
amitchandak
Super User
Super User

@Prodan , if there is any product in the table which is missing in product chances are there you can get blank values. Do you have such a case ?

 

Hi @amitchandak, There's no referential integrity violation between these two tables (if that's what you mean). You can check the content of them in the screenshot from my original message.

Greg_Deckler
Super User
Super User

@Prodan - How are those tables related? On what columns?


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

Hi @Greg_Deckler , they are related through the id and product_id column. See image below.

Prodan_1-1596551759745.png

 

 

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.