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
sp8
Helper II
Helper II

Related not working for calculated column even though relationship works in visuals

I have 2 tables with an active relationship (as seen in the visuals). When I try to create a calculated column in A (the many side), it gives me all of the autofill options properly. But when I hit enter, it says "the column [from B] either doesn't exist of doesn't have a relationship to any table available in the current context."

 

Any ideas? Is this some sort of bug?

 

Details:

A is via direct query (too big to move to import), and B is created by pulling from a different direct query table. I have a many:1 (A:B) relationship between them that works for visuals.

 

My tables look like:

A

ID#   data...

1        other columns...

2        other columns...

3        other columns...

4        other columns...

(it's distinct, even if Power BI doesnt recognize it as such for a 1:1 relationship)

 

B

ID# date

1        1/1

2        1/2

3        2/3

4        2/15

 

They are linked on ID# and I have tried both a one-way and a both direction.

When I make a basic table visual, I can see the correct results (showing that the relationship is active and working).

ID# from table A   date from table B

1                                     1/1

2                                     1/2

3                                     2/3

4                                     2/15

4 REPLIES 4
iolambda
New Member

I know this is an old thread but I am having this exact issue, is anyone able to help with a solution? 

@sp8 

v-xuding-msft
Community Support
Community Support

Hi @sp8 ,

 

I can’t reproduce your issue. I test it normally. I think it’s because my sample is too simple.  Maybe you could try to change the function of RELATED to RELATEDTABLE and wrap it in an aggregation function.

If you failed again, can you please share more details and the sample data?  Then we can help you as soon as possible.

1.jpg

 

Best Regards,

Xue Ding

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

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

 

 

@v-xuding-msft 

I continue to have this issue with multiple files and multiple tables. This time I have a 1:1 (direct query SAP Hana and Sharepoint online sources)

Latest example looks the same:

 

directquery1.PNG

And I can verify that the relationship works, because when I have a table visual, it can pull in the correct value from the Goals source table and correspond it to the correct lines in the DQ--- table.

When I try to add the column to pull the values to the DQ-- table directly, the autofill offers me RELATED and then offers me the correct column as a choice. (I'm not forcing anything.) But then it says it doesn't have a relationship that it clearly has.

ErrorError

 

 

 

relationshiprelationship

 

Above is my relationship.

When I try to create a new column in the many-side table that calls on the 1-side table, it gives me this error. I should be able to just pull the value in, since it's from a 1-side table (that is created by doing a distinct on the UTID field, so it 100% has distinct values there).

relateddoesntwork.png

 

Since it's in direct query, it doesn't even give me the choice to start with "calculate." Trying to aggregate via min/max doesn't seem to work either.

 

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.