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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
HitcH
Helper II
Helper II

Can't determine relationship between fields - Different details

Hello everyone,

I created a test simulation with two simple tables (+ two "bridge" table):

HitcH_1-1687425334959.png

 

As you can see there are two common fields (Brand and Customer) + field "Bonus type" that is available only in sheet 1.

 

Here is my problem:

HitcH_2-1687425573035.pngHitcH_3-1687425588458.png

In my example I have, for brand "M" and customer "a", total bonus value of 100 (50 bonus type "A" and 50 bonus type "B") and turnover value of 99.

The system doesn't know how to allocate my turnover value between bonus type A and B and so I get the error "Can't determine relationship", but I would like to see in both case the total amount of turnover, like this:

HitcH_4-1687425748441.png

 

In Excel this would be easy, is this also possible in PowerBI?

 

Thanks a lot!!!

1 ACCEPTED SOLUTION
rbriga
Impactful Individual
Impactful Individual

How about merging (joining) the two tables in the Query Editor?

  1. Choose the Sheet1 table
  2. Merge Sheet 2 into it by brand, customer and bonus type
  3. Expand Sheet1 with the column [Turnover] from Sheet2 
-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @HitcH ,

 

I have a test by your data model, I think it works well on myside.

vrzhoumsft_0-1687770316065.png

Result is as below.

vrzhoumsft_1-1687770335377.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

rbriga
Impactful Individual
Impactful Individual

Don't use SUM to summarize your bonus and turnover. Try:

Total Bonus = 
    VAR _Unique_Table= SUMMARIZE('Test Table','Test Table'[Brand],'Test Table'[Customer], "@Bonus",MAX('Test Table'[Bonus]))
    RETURN 
    SUMX(_Unique_Table, MAX([@Bonus]))

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Another big "thanks" and another step ahead. But also another question:

HitcH_0-1687438520183.png

Customer "a" and brand "M" has a total amount of bonus of 100 + brand "N" with extra 50. So the total "a" should be 150 and the total "a/M" should be 100:

HitcH_1-1687438615379.png

Is there a problem with the formula?

rbriga
Impactful Individual
Impactful Individual

Try the equivalent of:

Total Bonus = 
    VAR _Unique_Table= 
    SUMMARIZE('Test Table',
        'Test Table'[Brand],
        'Test Table'[Customer], 
        "@Bonus",SUM('Test Table'[Bonus])
        )
    RETURN 
    SUMX(
        _Unique_Table, 
        MAX([@Bonus])
    )

I've changed the summary in SUMMERIZE to SUM.

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!
rbriga
Impactful Individual
Impactful Individual

How about merging (joining) the two tables in the Query Editor?

  1. Choose the Sheet1 table
  2. Merge Sheet 2 into it by brand, customer and bonus type
  3. Expand Sheet1 with the column [Turnover] from Sheet2 
-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Hi rbriga.

First of all thanks for your support!
I didn't even know the merge function, but I studied and implemented it, with partial success:

HitcH_0-1687429096777.png

The two rows with the green note are fine, but the total for combination customer "a" and brand "M" is wrong, as the turnover is doubled.

Do you also know how to handle this?

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors