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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Creating relationships between two Calculated Tables - Many to One - Single Directional

Evening,

 

Not sure if its a bug or not but here goes,

 

I have a Calculated table for Order Date information that uses the below code to generate the Order Dates table.

 

Date = DISTINCT(SELECTCOLUMNS(MainTable, "Order Date", MainTable[Order Date], "Month", MainTabke[Order Date].[Month]))

(Theres a few more columns in the live example for Month Number, year and year number)

 

But when the table is produced it get this summary at the bottom;

table summary.PNG

 

So i know there is 3598 rows with 3598 unique dates,

 

Then there is the sales table which also contains the a refference to the Order Date but when i create a relationship between the two tables i get the below error;

Power Bi Error.PNG

 

Yet we know they are unique, from the summary image so why am i seeing the error?

 

Thanks in Advance,

 

J

4 REPLIES 4
Anonymous
Not applicable

I would double check by adding 2 measures:

  DC = DistinctCount(Date[Order Date])

  R = CountRows(Date)

They should show identical values...

 

Certainly multiple BLANK rows is the most common issue...

magsod
Solution Supplier
Solution Supplier

Hi Josh,

 

Are you sure that you don't have any blank values in the column Order Date?

 

If one row in the table contains a blank value in the table it will still show same number of distinct values as number of rows. However the blank value will prevent you from creating the relationship with your other table.

 

Br,

Magnus

Eric_Zhang
Employee
Employee

@Anonymous

Could you share the problematic pbix file? I'd inspect it and try to reproduce the issue.

Anonymous
Not applicable

Sorry due to the nature of the data i am running in Power BI i cant share the source PBIX, 

 

Thanks, 

 

Josh

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.