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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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.)
 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.