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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
mpros
Helper I
Helper I

Calculate + UseRelationship Syntax with N to N

Hi, 
why this isn't working? Is something related to N-N relationship? Any turnaround?

 

X(LW) = CALCULATE(sum(table[Quantity]), USERELATIONSHIP(CalendarFull[fnPreviousWorkday],table[_Datex]))

X = CALCULATE(sum(table[Quantity]), USERELATIONSHIP(CalendarFull[Date],table[_Datex])) 

X works aswell with just SUM[Quantity] as active relationship

 



mpros_0-1728489381833.png

mpros_1-1728489456215.png



Calendar Table

mpros_2-1728489746509.png

 

1 ACCEPTED SOLUTION
d_rohlfs
Resolver I
Resolver I

Hi @mpros,
Your relationship likely doesn't work just because you are using a Many-to-Many relationship. There are a LOT of nuances to using this type of relationship, and this could easily be affecting whether the UseRelationship dax function is allowed to work. 
This post from @amitchandak has a possible solution: Solved: USERELATIONSHIP and many to many - Microsoft Fabric Community

Also, your many-to-many relationship is Limited. This can also affect the useability of UseRelationship. To see what this means, look here:Model relationships in Power BI Desktop - Power BI | Microsoft Learn under "Limited Relationships (it's about half way down).



View solution in original post

1 REPLY 1
d_rohlfs
Resolver I
Resolver I

Hi @mpros,
Your relationship likely doesn't work just because you are using a Many-to-Many relationship. There are a LOT of nuances to using this type of relationship, and this could easily be affecting whether the UseRelationship dax function is allowed to work. 
This post from @amitchandak has a possible solution: Solved: USERELATIONSHIP and many to many - Microsoft Fabric Community

Also, your many-to-many relationship is Limited. This can also affect the useability of UseRelationship. To see what this means, look here:Model relationships in Power BI Desktop - Power BI | Microsoft Learn under "Limited Relationships (it's about half way down).



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.