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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
wcd1213
Frequent Visitor

Average of column by a value

Hi All,

I have a table with six columns. Column 1 and 2 are identifiers labeled by person and response number. Columns 3-5 are the scores that this person received and column 6 is the average across the three rows. I need to find a way to get the average of Q1-Q3 AVG split up by the name of the person. 

Here is the table from excel. 

InstructorResponse # Q1Q2Q3Q1-Q3 AVG
Person115423.67
Person125555.00
Person133443.67
Person141131.67
Person155555.00
Person165313.00
Person175423.67
Person215555.00
Person223544.00
Person234233.00
Person245454.67
Person255313.00
Person261432.67
Person274554.67
Person312443.33
Person323333.00
Person335555.00
Person344312.67
Person354433.67
Person365524.00
Person373333.00

For example rows 1-7 in the new column should be 3.67. 

(3.67 + 5 + 3.67 + 1.67 + 5 + 3 + 3.67) / 7 = 3.67

Please let me know if there is a specific formula to acheive this. Any help is appreciated. 

3 REPLIES 3
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @wcd1213 ,

You can try creating this measure - 

CALCULATE(AVERAGE('Table'[Q1-Q3 AVG]),ALLEXCEPT('Table','Table'[nstructor]))
 
Hope this helps!
 
Please accept the solution if this answers your query.
 
Thanks,
Avantika

Hi @Avantika-Thakur ,

Thank you for your response. 

I attempted to use this expression and the results were not filtered by Instructor.

The problem I think I am running into is the data coming from two different tables and I am creating a summary table. 

So the data in power bi is setup something like this:

Table1

Instructor  RespID

Person1  1
Person1  2
Person1  3
Person1  4
Person1  5
Person1  6
Person1  7
Person2  1
Person2  2
Person2  3
Person2  4
Person2  5
Person2  6
Person2  7
Person3  1
Person3  2
Person3  3
Person3  4
Person3  5
Person3  6
Person3  7

 

Table 2

RespID Q1   Q2    Q3

1542
2555
3344
4113
5555
6531
7542
1555
2354
3423
4545
5531
6143
7455
1244
2333
3555
4431
5443
6552
7333

Then, in Power Bi I use SUMMARIZECOLUMNS to bring the tables into a calculated table. From there I need the averages split by name. The result I get from using the ALLEXCEPT function is not filtered and returns one value for all rows. 

Is there a way to acheive this in a summarized table?

Thanks

Hi @wcd1213 ,

 

Now there is a problem, according to the sample data, table 1 and table 2 do not have a primary key, which leads to the formula does not know how to summarize the data.

 

As an example, it is not clear which Person in Table 1 corresponds to the first record of Table 2.

vcgaomsft_0-1665731872887.png

Is there a primary key in real data?

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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