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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
mukhan
New Member

Calculate difference from the average

Dear All, @

I am working on a table having five columns containing numeric values.

I am interested in calculating the average score of an individual based upon those five columns. Then, I would like to calculate

Total score individual / Avg score

and then plot it.

Any help will be appreciated.

 

Regards,

Umer

1 ACCEPTED SOLUTION
adudani
Memorable Member
Memorable Member

Hi @mukhan 

 

to get the average, you could duplicate the initial query ( assume name table2), group by the individual ID and calculate the average (assume column name is avgcolumn) .

 

for the total, in the first query by creating a measure:

 

Measure =
var _totalscore =Calculate( sum('Table'[ColumnName]) , All (Table))

var _avgscore =selectedvalue('Table2'[AvgColumn])

var _output = _totalscore/_avgscore

return 

_output

 

plotting the measure on values with individual id/name, might give the result.

 

If it doesn't ,could you provide sample input data and sample output removing sensitive data ?

 

Appreciate a thumbs up if this is helpful.

 

Thanks

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

4 REPLIES 4
ppm1
Solution Sage
Solution Sage

You'll likely want to unpivot those 5 columns. Sample data (inserted as a table, not an image) and expected output will help you get a specific solution.

 

Pat

 

Microsoft Employee

Thanks for replying. How can we embed pbix to the topic?

You can insert the data by adding a table from the ribbon, or you can upload your pbix to OneDrive or Google Drive and share link here.

 

Pat

Microsoft Employee
adudani
Memorable Member
Memorable Member

Hi @mukhan 

 

to get the average, you could duplicate the initial query ( assume name table2), group by the individual ID and calculate the average (assume column name is avgcolumn) .

 

for the total, in the first query by creating a measure:

 

Measure =
var _totalscore =Calculate( sum('Table'[ColumnName]) , All (Table))

var _avgscore =selectedvalue('Table2'[AvgColumn])

var _output = _totalscore/_avgscore

return 

_output

 

plotting the measure on values with individual id/name, might give the result.

 

If it doesn't ,could you provide sample input data and sample output removing sensitive data ?

 

Appreciate a thumbs up if this is helpful.

 

Thanks

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.