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
NathanPzi
Frequent Visitor

DAX Relation between DirectQuery and Import

Hello,
I have a report that contains multiple tables, one is in 'Import' mode, and the other is in 'DirectQuery' mode and is linked to another report.
Import: Grille tarifaire[Moyenne]
DirectQuery: Affaire[TJM Vendu]
I'm trying to create a calculated column with this function: Flag TJM PFSA = if(RELATED('Grille tarifaire'[Moyenne]) = BLANK(), 5, if(RELATED('Grille tarifaire'[Moyenne]) >= Affaire[TJM Vendu],1,10))

But Power BI is giving me this error: The column 'Grille tarifaire[Moyenne]' either doesn't exist or doesn't have a relationship with any table available in the current context.

However, I have established a relationship between the two tables using a reference, and the relationship is active with the correct cardinality.
And when creating the column using "RELATED", Grille tarifaire shows up as a suggestion.

If anyone has any tips or a solution to my problem, I would greatly appreciate it.

Thank you 🙂

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @NathanPzi ,

If the relationship is one to many, RELATED function can only be used in the many side table. In other words, 'Grille tarifaire' should be the one side in the relationship.

If not, you can use this formula to reference:

MAXX ( FILTER ( 'table2', 'table2'[column1] = 'table1'[column1] ), [column2] )

 

Best regards,

Community Support Team_yanjiang

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

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.

Top Solution Authors
Top Kudoed Authors