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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Error in Measure Using USERELATIONSHIP Function

Hello,

 

I can't figure out what the problem is with the following Measure: 

 

Measure = CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[Column1]="text")), USERELATIONSHIP(table1[column2],table2[column2])

 

The Calculate/Filter portion of the measure work fine. And the USERELATIONSHIP expression works fine on its own and in other measures. It's only when I put the two together that I start seeing problems. What's the issue? 

 

Thanks for your help! 

2 ACCEPTED SOLUTIONS

Well, if the CALCULATE is closed, then what is the USERELATIONSHIP part of? It wouldn't be part of any calculation at all from what I can see in the formula. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

You either want to drop this additional parenthesis, so that USERELATIONSHIP is included in your CALCULATE, or add another CALCULATE( before the first one.

From what you wrote, it seems you want to nest CALCULATEs, but I am not sure to understand why.

 

Edit: In the latter case, you also want to add an additional parenthis after USERELATIONSHIP(...)

 

 

View solution in original post

6 REPLIES 6
LaurentCouartou
Solution Supplier
Solution Supplier

What error message/issue do you have?

 

It seems to me you have an extra parenthesis right after your FILTER argument.

Anonymous
Not applicable

It says "The syntax for 'USERELATIONSHIP' is incorrect. 

 

WOuldn't two parentheses after Filter be correct? The first one closes the Filter argument and the second one closes the Calculate function. 

You either want to drop this additional parenthesis, so that USERELATIONSHIP is included in your CALCULATE, or add another CALCULATE( before the first one.

From what you wrote, it seems you want to nest CALCULATEs, but I am not sure to understand why.

 

Edit: In the latter case, you also want to add an additional parenthis after USERELATIONSHIP(...)

 

 

Anonymous
Not applicable

@LaurentCouartou @Greg_Deckler Thank you both! My (stupid) mistake was not inlcuding the USERELATIONSHIP function in Calculate... I was treating them as separate things. I removed the extra parenthesis and it worked fine. 

Well, if the CALCULATE is closed, then what is the USERELATIONSHIP part of? It wouldn't be part of any calculation at all from what I can see in the formula. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

For some added context, my goal is to create a measure that counts a filtered number of rows, and once it has that count, applies a specific relationship.  

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.