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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Calculating Test Scores by Question and by User

Hello,

 

I am having some difficulties trying to work out something in DAX/Power BI that I know how to do in Excel. Am taking my first stepts in Power BI and DAX and could really use some help.

 

Say that one of the Data Sources are a table with test results from a list of test takers as below.

 

 Question 1 ScoreQuestion 2 ScoreQuestion 3 Score User Score
User1311 0.555555556
User2313 0.777777778
User3213 0.666666667
      
 Question Scores0.8888888890.3333333330.777777778  

 

 

I like to have both User and question scores so that I can track success by user and by question.

I am using the current formulas in Excel.

 

 Question 1 ScoreQuestion 2 ScoreQuestion 3 ScoreUser Score
User1311=SUM(B3:D3)/(COUNTA(B3:D3)*3)
User2313=SUM(B4:D4)/(COUNTA(B4:D4)*3)
User3213=SUM(B5:D5)/(COUNTA(B5:D5)*3)
     
 =(SUM(B3:B5))/((COUNTA(B3:B5))*3)=(SUM(C3:C5))/((COUNTA(C3:C5))*3)=(SUM(D3:D5))/((COUNTA(D3:D5))*3) 

 

I want to replicate the same calculations in Power BI but cannot find a way to lock the SUM and COUNTA ranges to a limited array of cells. 

 

Or maybe this is the wrong way of doing it....

 

Thank you for your help.

2 ACCEPTED SOLUTIONS
waltheed
Impactful Individual
Impactful Individual

Hi jagostinhoCT,

 

Yes you can do it, in two ways...

 

If you keep the structure of your table the way it is now, it's more manual work and not so flexible..

Create a calculated column, called avgscore:

= ([q1] + [q2] + [q3] ) /3

 

Add measures for each question (column):

avgscore q1:=AVERAGEX('ScoreTable';[q1])

avgscore q2:=AVERAGEX('ScoreTable';[q2])

avgscore q3:=AVERAGEX('ScoreTable';[q3])

 

(You divide everything by 3 again, but I skipped that :-))

You could use those like in the pivot table shown below.

 

Score.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

It would be better to change the table structure, like the one in the screenshot above, with columns: User, Question, and Score. So just one column for the questions!

 

Then you would only need ONE measure:

avg score:=AVERAGEX('MyTable'; [score])

 

Then drag the avg score measure,the row headers, and column headers in and everything just works!

 

 

 

 

Cheers, Edgar Walther
ITsmart BI and Analytics consultant

View solution in original post

chrisu
Responsive Resident
Responsive Resident

3 REPLIES 3
chrisu
Responsive Resident
Responsive Resident

 

 

waltheed
Impactful Individual
Impactful Individual

Hi jagostinhoCT,

 

Yes you can do it, in two ways...

 

If you keep the structure of your table the way it is now, it's more manual work and not so flexible..

Create a calculated column, called avgscore:

= ([q1] + [q2] + [q3] ) /3

 

Add measures for each question (column):

avgscore q1:=AVERAGEX('ScoreTable';[q1])

avgscore q2:=AVERAGEX('ScoreTable';[q2])

avgscore q3:=AVERAGEX('ScoreTable';[q3])

 

(You divide everything by 3 again, but I skipped that :-))

You could use those like in the pivot table shown below.

 

Score.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

It would be better to change the table structure, like the one in the screenshot above, with columns: User, Question, and Score. So just one column for the questions!

 

Then you would only need ONE measure:

avg score:=AVERAGEX('MyTable'; [score])

 

Then drag the avg score measure,the row headers, and column headers in and everything just works!

 

 

 

 

Cheers, Edgar Walther
ITsmart BI and Analytics consultant
Anonymous
Not applicable

@waltheed

 

Many thanks.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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