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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
albertax
Frequent Visitor

Calculated Use Relationship is not returning count

Hi Team, 

 

I have two tables that are joined together by an inactive relationship, many to many both directions.


Table A: Name

Table B: CompletedByName

 

My measure is not returning the desired result:

 

This is my measure which is a calculated measure: 

 

CALCULATE(

COUNTROWS(Table A),

TREATAS(VALUES('Table A'[Name]), Table B[CompletedByName])

)

 

Any ideas? This has been going no where for me for a few hours

 

2 REPLIES 2
Anonymous
Not applicable

Hi @albertax 

Your relationship is inactive, you need to use USERELATIONSHIP() function to active the relationship.

Measure =
CALCULATE (
    COUNTROWS ( 'Table A' ),
    USERELATIONSHIP ( 'Table A'[Name], 'Table B'[CompletedByName] )
)

 And you can refer to the following information about the function.

USERELATIONSHIP function (DAX) - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

 

danextian
Super User
Super User

Hi @albertax ,

 

Can you please post your pbix with condidential data removed?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors