Forum Discussion
Error creating relationship with ADX table in PowerBI modeling— duplicate values on “one” side
- 9 months ago
Thank you, rohit1991 for your response.
Hi MiluMaria,
Thankyou for the followup.
Based on my understanding, even if the dimension table contains unique keys in ADX, Power BI requires one side of a relationship to be guaranteed unique under all possible query and filter contexts. Since ADX does not expose enforced primary key constraints, Power BI cannot guarantee this at query time and, therefore, blocks a one-to-many relationship. This can surface after model recreation or metadata refresh when cardinality is revalidated. Replicating the table in Power BI does not alter this behavior because the validation still occurs against ADX at query execution.
The possible solution is to adopt a composite or hybrid model by creating a distinct dimension (one row per key) and loading it in Import mode, while keeping the fact table in DirectQuery. This pattern ensures stable relationships. If Import is not feasible, a many-to-many relationship with appropriate DAX adjustments can be used, keeping in view performance considerations.
Additionally, please refer to the links provided below:
DirectQuery in Power BI: When to Use, Limitations, Alternatives - Power BI | Microsoft Learn
Model relationships in Power BI Desktop - Power BI | Microsoft Learn
Use composite models in Power BI Desktop - Power BI | Microsoft Learn
Composite model guidance in Power BI Desktop - Power BI | Microsoft Learn
Many-to-many relationships in Power BI Desktop - Power BI | Microsoft LearnWe hope the information herein helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
Hii MiluMaria
In DirectQuery mode, Power BI validates relationship cardinality at query time, not at design time, and if the key column is not guaranteed unique under all possible filter contexts, Power BI blocks a 1-to-many relationship and raises the “duplicate values on the one side” error. This can appear suddenly after reconnecting, refreshing metadata, or recreating the model even if the relationship worked earlier because the engine re-evaluates uniqueness more strictly. The correct fix is to avoid 1-to-many relationships in DirectQuery ADX, or introduce a dedicated dimension table (Import mode or summarized ADX table with DISTINCT keys) and relate facts to that dimension instead.
- MiluMaria9 months agoNew Member
I am only creating a relationship between a dimension table and a fact table, and I have ensured that the dimension table contains unique keys.