Forum Discussion

gopala000's avatar
gopala000
Frequent Visitor
1 year ago
Solved

Relation with null value for dimension key in fact table errors on creating a report

I have a 1:N between a dimension table and fact table in Fabric LakeHouse. Note that some fact records may have null value for the dimension key. I created a many to one relation between fact and dimension in the semantic model with "assume referential integrity" checkbox turned off.  When I created a report with columns from the fact and dimension table, I get the error below. How do I define the semantic model for such a relationship? Is there any PowerBI setting that needs to suppress the error validation?

 

Column '<oii>UserId</oii>' in Table '<oii>userfact</oii>' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.
Please try again later or contact support. If you contact support, please provide these details.
Hide details
Activity ID8d78974e-d77b-4833-982e-1df50b7edf01
Request IDeb080e40-77d4-cd8e-923b-10518a89b45d
Correlation IDd292750d-d049-4515-1d9b-a264fb127bd7
TimeTue Jan 21 2025 19:32:55 GMT-0800 (Pacific Standard Time)
Service version13.0.24945.38
Client version2412.3.22264-train
Cluster URIhttps://wabi-us-west2-redirect.analysis.windows.net/

  • I solved the issue by changing the dimension key from null value to empty string and the error went away. Other option that I tried and that worked was to create a dimension record called "Not Applicable" and use that primary key instead of null in the Fact table.

2 Replies

  • v-kpoloju-msft's avatar
    v-kpoloju-msft
    Community Support

    Hi gopala000,

     

    May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

     

    Thank you.

  • gopala000's avatar
    gopala000
    Frequent Visitor

    I solved the issue by changing the dimension key from null value to empty string and the error went away. Other option that I tried and that worked was to create a dimension record called "Not Applicable" and use that primary key instead of null in the Fact table.