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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MarcUrdang
Post Patron
Post Patron

Related Function

We would like some help on the following: How to use a field in one Table in a second Table for example: We have one Table showing airlines with their related codes ie: column1 =SAA , column 2 = 123. Also we have another Table showing a myriad of Shipment data. You could have many lines here to one in the Airline Table. In the Shipment Table we have a field which we have used to extract th first three digits of and created another field called '3digits'.

 

We need to now use the RELATED function to allow us to use both fields in one calculation, for example:

 

IF ((Airline Table[column2] = Related(Shipment Table[3digits],"y","n")

 

We have also linked the tables with a many to many relationship and it PBI seems happy with that.

We get an error message when creating the calc: these are the actual table/field names below.

Any help would be appreciated.

 

The column 'Consol INBOUND[AirConol3]' either doesn't exist or doesn't have a relationship to any table available in the current context.

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @MarcUrdang ,

 

After my test, you could refer to the following DAX:

Column =
IF (
    'Table 2'[3digits]
        = CALCULATE (
            SELECTEDVALUE ( Airline[Column2] ),
            ALLEXCEPT ( Airline, Airline[Column1] )
        ),
    "y",
    "n"
)

 

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

Wow .. this seems to work .. thanks so much ...

 

However if I want to replace the "y" and the "n" with a table column is that possible? It does't seem to accept.

 

I can mail you the excel workbook and PBI file to show you what I mean .. not sure if you happy to send out your mail address.

 

thanks
Marc

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors