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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
yogeshk77
Helper I
Helper I

Average of Count of Items from Relationship table

Hi,

I need to find average of Count of items that refers to one many relationship child table.

 

I have following tables & their relations

Parent Stories table

yogeshk77_0-1665139581595.png

 

Has one to many relation with Child table

yogeshk77_1-1665139644736.png

Notice How PR ID repeats for a different Stories

 

Now, I need a measure (Say "Measure Avg PR Count"), that'll give me the Average number of PRs against each Story Points, like below -

yogeshk77_2-1665139740293.png


Can someone please help ?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can try the below measure

Avg num PRs =
AVERAGEX (
    VALUES ( 'Stories'[Story ID] ),
    COUNTROWS ( RELATEDTABLE ( 'PRs Stories' ) )
)

This assumes that a PR can occur in multiple stories but can only appear once per story.

Put this in a visual with the story points column and I think it should work.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

You can try the below measure

Avg num PRs =
AVERAGEX (
    VALUES ( 'Stories'[Story ID] ),
    COUNTROWS ( RELATEDTABLE ( 'PRs Stories' ) )
)

This assumes that a PR can occur in multiple stories but can only appear once per story.

Put this in a visual with the story points column and I think it should work.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.