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
Kenmare
Frequent Visitor

Measure to count items in the relatedtable

Hi !

 

I have a table called Round in which there are several events stored in a table called Event.

They are linked by the RoundId like this :

Model.png

 

 

 

 

 

The idea of my measure is to count, for each round, how many events are stored.

The relation is active in my model (even tried with USE RELATIONSHIP), I don't know what is wrong in the following measure :

Number of events = CALCULATE (COUNTROWS(RELATEDTABLE(event)))
 
Indeed the result is not good when I try to put it in my report:
Result.png
 
 
 
 
ID is correct but no result is displayed when adding the measure.
Have you got an idea ? I found a lot of answers in other topics but no one worked for me.
Thanks !
2 REPLIES 2
gmsamborn
Super User
Super User

Hi @Kenmare 

A measure to use in a table like that would be:

No of Events = DISTINCTCOUNT( 'Table Events'[EventID] )
 
Your DAX works as a calculated column on your 'Table Round' table since that is on the one side of the one-to-many relationship with 'Table Events'.
(In a measure like your DAX, how would you be specifying which table 'Table Events' is related to?  You can't.)
 


Proud to be a Super User!

daxformatter.com makes life EASIER!

Hi @gmsamborn 

 

Thank you for your reply. I thought having the round id in my chart could help. 

But it doesn't seem to be possible / a good idea.

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