PlantOps BI

Direct Lake Relationship Skipped Because the Key Column Is Double

Skip to the fix

Symptom

In a Direct Lake model, one of my 21 relationships had to be skipped. The key on the fact table side, a downtime reason ID, was Double in the Delta table, and the dimension key was an integer. I did not record an exact error string, so there is none to quote here.

Cause

The column was written to the lakehouse as a floating point type. The notebook I use to load the tables did not cast it to an integer.

Fix

Two parts. I did both, and I would do both again.

  1. Fix the source. I recast the two affected columns in Delta to bigint, then committed an integer cast in the load notebook so a rebuild does not bring the problem back.
  2. Fix the model. The Properties pane in model view did not show a data type dropdown for Direct Lake columns, only General and Name. In TMDL view I switched to Editing mode, dragged the fact table in from the Data pane to get its full definition, used Find to jump to the column, changed double to int64 on its dataType line, and applied. The message was “Changes applied to the model”.

Then I applied the relationship in a fresh script tab and refreshed the model from the workspace list.

How I Proved It

Home, then Manage relationships, showed the relationship as Active, many to one, from the fact table column to the dimension key. I did not run a DAX query against it, because the query editor would not stay open under my automation.