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

Error using RELATED

Hello everyone, I have searched all over the forum and I have not found an answer that will solve me.

I'm working with Direct Query, I have 2 tables:

imagn.png

The link field is Phone and as you can see it is many to one. I want to insert a column in A that indicates when the same value is set to B.

objetivo.jpg

I tried RELATED and the resutlado is this message: "The column 'B[Phone]' either doesn't exist or doesn't have a relationship to any table available in the current context."

Even (allows me) by changing the relationship one by one, the same error appears.

I've tried other formulas that I've found on the internet without solving this.
Thank you.

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

Hi @elflakoconk ,

You can create a measure as below:

Measure = 
VAR _btelefono =
    CALCULATE (
        MAX ( 'B'[Telefono] ),
        FILTER ( 'B', 'B'[Telefono] = MAX ( 'A'[Telefono] ) )
    )
RETURN
    IF ( NOT ( ISBLANK ( _btelefono ) ), "Si", "No" )

error using related.JPG

Best Regards

Rena

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

Thank you very much, this worked!!! The Microsoft team told me that interactions with DirectQuery may present some flaws with SQL Server, in my case it happened, but this is resolved.

Thanks a lot.

Hi @elflakoconk ,

If the problem has been resolved, could you please mark the helpful post as Answered? It will help others in the community find the solution fast when they face the same problem with you. Thank you.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ryan_mayu
Super User
Super User

@elflakoconk 

If you want to use related , try this

Column = 
VAR _value=MAXX(FILTER(B,RELATED(B[telefono])),B[value])
return if (ISBLANK(_value),"No",_value)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@elflakoconk , Related you can use in 1- M relation on M side.

 

you can also move data like this from on table to another

City Name = maxx(FILTER(geography,geography[City Id]=Sales[City Id]),geography[City]) // New column in sales table in my case

 

Minx/maxx/sumx depend on need

Thanks a lot, i'll try this! and will give my feedback

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.