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

Fabric Ideas just got better! New features, better search, and direct team engagement. Learn more

Power BI Direct Query Bug to give error on existing Many-to-One Relationships in Data Model

Assume in your data model you have Many-to-One relationship between your 'FactTbl' and 'DimTbl' on the column 'CustomerKey' and the the connection is in DirectQuery mode.

 

Now assume that bad data is entered in your 'DimTbl' and it has caused that you have a duplicate value in the column 'CustomerKey' of your 'DimTbl'.

If you refresh your Power BI, it gets refreshed successfully without any errors.

 

Now what happens? If you have created visualizations before, you might see some data in your visuals that is too weird which are caused by Many-to-Many Relationship behavior. You go and check your data model to find out the reason and it shows you that the relationship is Many-to-One and it is too frustrating as you cannot find the reason of what you see !

 

But the same case in Import mode works fine and once you hit the Refresh button in Power BI, it gives you the error:

"Column CustomerKey contains a duplicate value and this is not allowed for columns on the one side of a many-to-one relationship or for the columns that are used as the primary key of a table".

 

The same error is expected in DirectQuery mode as well and it needs to be fixed.

 

Regards,

Loran

Status: New