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
Anonymous
Not applicable

How to find average from 2 different table

hello Guys, Hope you are doing well. 

May I know how can I calculate the average score from 2 different table that have one to many relationship ? kindly refer to the example below. 

Table in yellow have one to many relantionship to both green color table. 
The expecting result is, 

Suplier 1 should be (10+10+ 20)/3

Supplier 2 should be (20+20)/2

Supplier 3 should be (30+30)/2

May I know how can i create a new column in data view and generate the result as indicate below ? 

nicksonteh_0-1660545635130.png

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Picture2.png

 

Avg expected result CC = 
DIVIDE (
    SUMX ( RELATEDTABLE ( Score1 ), Score1[Score] )
        + SUMX ( RELATEDTABLE ( Score2 ), Score2[Score] ),
    COUNTROWS ( RELATEDTABLE ( Score1 ) ) + COUNTROWS ( RELATEDTABLE ( Score2 ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Zach98
Frequent Visitor

A procurement category refers to a specific grouping or classification of goods, services, or supplies that are procured by an organization. Categories are typically created based on similarities in terms of the type of product or service, industry, function, or strategic importance. The purpose of categorizing procurement is to facilitate effective management, analysis, and strategic decision-making within each specific area of spend.

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Picture2.png

 

Avg expected result CC = 
DIVIDE (
    SUMX ( RELATEDTABLE ( Score1 ), Score1[Score] )
        + SUMX ( RELATEDTABLE ( Score2 ), Score2[Score] ),
    COUNTROWS ( RELATEDTABLE ( Score1 ) ) + COUNTROWS ( RELATEDTABLE ( Score2 ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

YEA. IT WORKS FROM MY SIDE. THANK YOU SO MUCH !

 

MahyarTF
Memorable Member
Memorable Member

Hi,

In Power Query, you could Append two tables as new or in one of them,

Then use the created table and bring the "Supplier name" and average of Score in your visual :

MahyarTF_0-1660548783564.png

Appreciate for Kudos

Mahyartf

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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