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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Franky_Piferoen
Frequent Visitor

Incorrect errormessage can´t create a relationship between two columns because one of the columns ..

Hi,


I've found a lot of posts about 'can´t create a relationship between two columns because one of the columns must have unique value'.

But I think I got this error while it was not supposed to happen.


I have a date dimension table and a fact tabel, in both these tables the date field is marked as 'date/time' datatype.
When I tried to make a relationship between the date dimension and the date field in the fact table I got that error. I was sure my date dimension table only contained unique values.


I tried to make this clear to powerbi by adding an extra 'applied step' remove duplicates for the data dimension query.

But this error still happened.


I finaly solved this by removing the 01/01/0001 record from my date table(which did not occur twice).

 

Would this be a bug or is there another explanation for this ?

 

thx in advance for feedback

 

 

1 ACCEPTED SOLUTION

Hi Phil,

 

some extra information

 

I use views in sql server as sources for powerbi.

When I remove the where DD.FullDate <> '0001-01-01' from that view and refresh the data in powerbi I get the error 'Column Fulldate' in table SiteEventDate' contains blank values and this is not allowed for columns on the one side of the many-to-one relationschip ...

 

When I add the where clause again in my view I can load the data without problems.

View solution in original post

4 REPLIES 4
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @Franky_Piferoen

 

How did you create your date dimension?  


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil,

 

The source is a dimension table in my sql database.

the definition:

let
    Source = Sql.Database(SqlServerInstancename, "MyDbName"),
    dbo_SiteEventDate = Source{[Schema="dbo",Item="SiteEventDate"]}[Data],
    #"Duplicated Column" = Table.DuplicateColumn(dbo_SiteEventDate, "CalendarQuarter", "CalendarQuarter - Copy"),
    #"Renamed Columns" = Table.RenameColumns(#"Duplicated Column",{{"CalendarQuarter - Copy", "CalendarQuarterQ"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"CalendarQuarterQ", type text}}),
    #"Added Prefix" = Table.TransformColumns(#"Changed Type", {{"CalendarQuarterQ", each "Q" & Text.From(_, "en-GB"), type text}}),
    #"Removed Duplicates" = Table.Distinct(#"Added Prefix", {"FullDate"})
in
    #"Removed Duplicates"

 

 

Hi Phil,

 

some extra information

 

I use views in sql server as sources for powerbi.

When I remove the where DD.FullDate <> '0001-01-01' from that view and refresh the data in powerbi I get the error 'Column Fulldate' in table SiteEventDate' contains blank values and this is not allowed for columns on the one side of the many-to-one relationschip ...

 

When I add the where clause again in my view I can load the data without problems.

It does seem like weird behaviour.

 

If you create a Date table in DAX using the CALENDARAUTO function, are you able to make a relationship?

 

Otherwise it might be a good idea to use the "send a frown" feature in PBI so the dev teams can pick up on a potential bug you have found. 🙂


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.