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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Dataslug
New Member

Unable to create a relationship in Semantic model

Hello, I have a semantic model built using tables from a Fabric Warehouse. 

I am attempting to create a relationship between two fields which both show as being integer fields, but when I try to create the relationship, I get this error:

The operation is not allowed because the data types of Direct Lake relationship between foreign key column 'JT_TASK'[WO No](Double) and primary key column 'WORK_ORDER'[WO No](Int64) are incompatible.

 

I have checked and double checked and both are set up as Int64 integer fields. Any ideas why this is happening? 

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hi @Dataslug 

 

This happens because even though both look like integers, one column is actually stored as Double and the other as Int64 in Direct Lake. Relationship needs the exact same type.

Fix:

  • Make both columns the same type at source (e.g., BIGINT), or use a view with CAST([WO No] AS BIGINT).

  • Refresh schema in the model and then create the relationship.

  • If you can’t change the source, use Import mode instead and set both as Whole Number.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

2 REPLIES 2
Dataslug
New Member

Thank you @rohit1991 

 

Just to be clear to others who may experience this, I did open up the gen2 dataflow, refresh the schema for the destination, and republish it. I then opened the semantic model I had built, and used the botton at the top to "Edit Tables". This allowed me to refresh. Once I did this, I was able to set up the relationship. 

rohit1991
Super User
Super User

Hi @Dataslug 

 

This happens because even though both look like integers, one column is actually stored as Double and the other as Int64 in Direct Lake. Relationship needs the exact same type.

Fix:

  • Make both columns the same type at source (e.g., BIGINT), or use a view with CAST([WO No] AS BIGINT).

  • Refresh schema in the model and then create the relationship.

  • If you can’t change the source, use Import mode instead and set both as Whole Number.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (6,264)