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 September 15. Request your voucher.
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
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.
Hi @albertax ,
Can you please post your pbix with condidential data removed?
User | Count |
---|---|
71 | |
63 | |
60 | |
49 | |
26 |
User | Count |
---|---|
117 | |
75 | |
62 | |
55 | |
43 |