The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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"
)
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