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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
albertax
Frequent Visitor

Count number of items in another table without relationship

Hi Team, 

I am unable to join two tables together by their IDs due to ambiguity in a relationship error. So as a way around this, I wanted to do a CALCULATE, FILTER 

 

countActions = CALCULATE (COUNTROWS('Hazards'), 

FILTER ('Actions',

'Actions' = Hazards'[ID])

)

 

My Hazards table has a unique ID for the hazard, and then a referenceID which i can relate back to the action. I am wanting to count the number of Actions associated with each Hazard.

 

Any ideas on how to fix my error? 

 

 

1 REPLY 1
Arul
Super User
Super User

@albertax ,

try the below

countActions = CALCULATE (COUNTROWS('Hazards'), 
FILTER ('Actions',
'Actions'[referenceID] = Hazards'[ID])
TREATAS(VALUES('Actions'[referenceID]), Hazards'[ID])
)

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.