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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

splitting one table into two - relationships don't work

 

 

I'd like to create a simple table in a report which has 3 columns

  1. Sales contract name (held in Sales Contract table)
  2. Agency Primary (held in Sales Contract Agency Table, with a "primary" flagged on the row)
  3. Agency Secondary (if there is any,held in Sales Contract Agency Table, with a "secondary" flagged on the row)

 

I have 2 data/tables: 

  1. Sales Contract
  2. Sales Contract Agency

 

The Sales Contract Agency table has a heap of agencies in it related to the Sales Contract ID. Some of the Agencies are a primary agency for the said sales contract, while others are secondary - but they are held in the same table. 

 

In PBI I have created one "Sales Contract Agency Primary" table, and filtered by "primary", and another table  "Sales Contract Agency Secondary" table, and filtered by "secondary" and have related both those tables back to the Sales Contract ID in the Sales Contract table. The relationships are good, so I have 3 tables:

 

  1. Sales Contract
  2. Sales Contract Agency Primary
  3. Sales Contract Agency Secondary

Data from Sales Contract and EITHER ONE of "Sales Contract Agency Primary" or "Sales Contract Agency Secondary" can exist in a table, but not data from all three - I get a relationship error (and this is from the frown report)


"Cant display the data because PBI can't determine the relationship between two or more fields"

 

OData Error Message:
Not showing data for DataShape 'DS0' because it's not clear how these fields are related.

 

Any clues as to why this happens? 

5 REPLIES 5
Greg_Deckler
Super User
Super User

Can you supply some sample data (text), a screen shot of the table relationships and a sample of the visualization you are trying to achieve (obviously a mock-up of it). One thing to try, try switching the relationships to be filtered one way versus cross filtering in both directions and see if that resolves the issue (from primary and secondary to your main fact table).


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for the reply - I tried switching from both to single but no cigar.

 

It seems to only occur when I load it into a SQL DB and use DirectQuery (occurs when using SQL as source, no matter if DQ or Import) - when I load in the excel files it works fine. I have the CSVs, PBIX and MSSQL bacpac files here: https://dl.dropboxusercontent.com/u/419424/pbitest.zip

 

here's some clean data that exhibits the issue when loaded into a DB

 

Sales Contract

SalesContractNumberSalesContractIDStartDateEndDate
5000032E897C4-A6E5-453C-80F8-2BB26979766828-11-2016 0:0004-12-2016 0:00
500013BE5B249-67D1-4E20-B667-68BE7AC2EAD028-11-2016 0:0004-12-2016 0:00
5000288EA05EC-69A1-4050-9A03-FEFAE51CBE5128-11-2016 0:0004-12-2016 0:00
500031BBA8B5C-1A55-4168-BA31-E41D9FB4FCCF28-11-2016 0:0015-12-2016 0:00
500048BCF9EEE-575B-47C5-AE4A-E5914F15508028-11-2016 0:0004-12-2016 0:00
500050C2F3C0E-C3C4-4328-8E60-2B7F84F84AE728-11-2016 0:0004-12-2016 0:00
500068F268AC4-D72D-4A37-A56F-356A9994712005-12-2016 0:0011-12-2016 0:00
5000739BDDE5C-D150-4D5F-98F7-F086E7C3CC5928-11-2016 0:0025-12-2016 0:00
50008CFEA5F10-3E44-4810-8BD5-51E830D5007F05-12-2016 0:0011-12-2016 0:00
50009A4120A87-3E51-4772-9122-CC122585245705-12-2016 0:0011-12-2016 0:00
50010FA574D2A-DB10-49A1-968C-6B82DB64E02105-12-2016 0:0008-01-2017 0:00
50011F0005343-CDD4-408F-B780-3D537C941A8805-12-2016 0:0011-12-2016 0:00
50012E29E25AC-BABE-4A8B-ACCF-B0D9C4A6CA4D05-12-2016 0:0011-12-2016 0:00
5001397D25190-CB7B-4AC0-8360-6D61B8EE608105-12-2016 0:0011-12-2016 0:00
500143152263A-A687-4BA0-A1BB-A8ADF930FD3019-12-2016 0:0015-01-2017 0:00
500152793B2D1-FDD2-4816-8D9B-0E262EB058C612-12-2016 0:0008-01-2017 0:00
50016D8827889-F0A7-466D-8B92-50262166ED9F08-12-2016 0:0027-08-2017 0:00
5001755F2AC01-B77B-4D78-B614-0006BC87073726-12-2016 0:0022-01-2017 0:00
50018147D019A-BEFF-40C8-9826-C0A3E19F2F5220-02-2017 0:0020-03-2017 0:00
50019933AB1B0-D5A2-42C2-AC2E-9093CF48906213-12-2016 0:0009-01-2017 0:00
500209A9F29B8-559D-4C19-BACA-B07DB3EC3E8F12-12-2016 0:0008-01-2017 0:00
50021C63AFD7F-B0B9-443C-923E-9A15BB02443212-12-2016 0:0008-01-2017 0:00
50022643DFF52-4766-4ED8-B93F-2120A030B4DF12-12-2016 0:0018-12-2016 0:00
50023FC7A71CE-3E00-409C-BF7B-61CCE8DC3F2812-12-2016 0:0008-01-2017 0:00
50024410D24BF-8872-4307-9144-C2F20CF6AF8112-12-2016 0:0008-01-2017 0:00
50025C5C18B2F-E27D-42DB-82F7-A39011E7B9E012-12-2016 0:0008-01-2017 0:00
500264997A35A-3BAD-473D-8B46-B9A64914CD5812-12-2016 0:0008-01-2017 0:00
50027383D39FA-2300-4924-8CBF-D361C4A7CFBA  
5002816B5C99F-45D7-462C-B5AD-05EBE75FB77713-12-2016 0:0018-12-2016 0:00
5002952A15FBF-21CB-47CF-B824-0DA62059FE4C13-12-2016 0:0018-12-2016 0:00
500308CA691B8-5486-4F77-8DDD-BE349464D9CF13-12-2016 0:0018-12-2016 0:00
50031A7D6BF59-CA3E-450D-BB7F-78381348F05D13-12-2016 0:0025-12-2016 0:00
500327D844B4E-62AE-4A06-9E8D-ED44D4FFDE1C13-12-2016 0:0018-12-2016 0:00
5003353064373-6EA2-4FE8-80B1-2948C30D73A5  
50034C610B674-8AA1-433A-89FD-AD51C4E672BB14-12-2016 0:0010-01-2017 0:00
500358A278608-DFC3-4388-90B1-FEEC518B884D  
500363FFD15E0-0767-44AC-82F1-873794D327D5  
50037EA11ECD2-CE6B-48C0-97BD-47A2E98ABFC4  
500380B0249E0-8CFC-40A3-B21D-36096EE8804919-12-2016 0:0015-01-2017 0:00
5003951B22F13-1FFE-438F-915D-94B25D05DF1E18-12-2016 0:0014-01-2017 0:00
50040EB8C76D0-F747-41E9-99B9-BB3D6C3C4DD919-12-2016 0:0019-12-2016 0:00
500410C037EDE-2D5F-4313-BC7A-CFBC9F34C16E19-12-2016 0:0019-12-2016 0:00
5004263D99E7B-8C5F-4608-AD53-003BD63E0E4119-12-2016 0:0019-12-2016 0:00
500438E246393-C2F1-4573-BD17-A65F89AB2AB021-12-2016 0:0017-01-2017 0:00
50044982112EE-C276-4847-92F7-E0F1CDD0E1C021-12-2016 0:0023-12-2016 0:00

 

Agencies

SalesContractIDTypeAgencyName
0C037EDE-2D5F-4313-BC7A-CFBC9F34C16EPrimaryPILOT- Agency 1
147D019A-BEFF-40C8-9826-C0A3E19F2F52PrimaryBenefit Media
147D019A-BEFF-40C8-9826-C0A3E19F2F52SecondaryAgency OIU
16B5C99F-45D7-462C-B5AD-05EBE75FB777PrimaryPILOT- Agency 1
3152263A-A687-4BA0-A1BB-A8ADF930FD30PrimaryAgency ABC
32E897C4-A6E5-453C-80F8-2BB269797668PrimaryPILOT- Agency 1
3BE5B249-67D1-4E20-B667-68BE7AC2EAD0PrimaryPILOT- Agency 1
51B22F13-1FFE-438F-915D-94B25D05DF1EPrimaryPILOT- Agency 1
52A15FBF-21CB-47CF-B824-0DA62059FE4CPrimaryPILOT- Agency 1
53064373-6EA2-4FE8-80B1-2948C30D73A5PrimaryAdvertCorp
55F2AC01-B77B-4D78-B614-0006BC870737PrimaryIKEN Worldwide
55F2AC01-B77B-4D78-B614-0006BC870737PrimaryBNE Media
55F2AC01-B77B-4D78-B614-0006BC870737SecondaryBBC Limited
63D99E7B-8C5F-4608-AD53-003BD63E0E41PrimaryPILOT- Agency 2
643DFF52-4766-4ED8-B93F-2120A030B4DFPrimaryPILOT- Agency 1
7D844B4E-62AE-4A06-9E8D-ED44D4FFDE1CPrimaryPILOT- Agency 1
8BCF9EEE-575B-47C5-AE4A-E5914F155080PrimaryPILOT- Agency 2
8CA691B8-5486-4F77-8DDD-BE349464D9CFPrimaryPILOT- Agency 2
8E246393-C2F1-4573-BD17-A65F89AB2AB0PrimaryHELLO Worldwide
8E246393-C2F1-4573-BD17-A65F89AB2AB0SecondaryPOS Agency
8F268AC4-D72D-4A37-A56F-356A99947120PrimaryPILOT- Agency 1
933AB1B0-D5A2-42C2-AC2E-9093CF489062PrimaryOMX 
933AB1B0-D5A2-42C2-AC2E-9093CF489062Secondary 
982112EE-C276-4847-92F7-E0F1CDD0E1C0PrimaryPILOT- Agency 1
C610B674-8AA1-433A-89FD-AD51C4E672BBPrimaryPort Agency
D8827889-F0A7-466D-8B92-50262166ED9FPrimaryUniversal
EA11ECD2-CE6B-48C0-97BD-47A2E98ABFC4PrimaryAD Effects
EA11ECD2-CE6B-48C0-97BD-47A2E98ABFC4SecondaryPort Agency
EB8C76D0-F747-41E9-99B9-BB3D6C3C4DD9PrimaryPILOT- Agency 1

 PrimaryPrimarySecondarySecondary

 

Thanks, I'll take a look and see if I can recreate the issue. Sounds like from what you describe it only occurs when using DirectQuery, correct?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks Smoupre, I appreciate it. It appears to only occur when a SQL datasource is used, no matter if it's DQ or Import. It works fine as CSV file data source.... both examples as 2 pbix files are in the above zip. You'll need to put the bacpac in a "pbitest" MSSQL db on localhost or change the data source if the DB is located elsewhere.

Was this ever resolved and if so how did you overcome this?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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