super_gallagher
super_gallagher

Reputation: 67

Average of Score based on Distinct ID

I have a table where a Student's GPA shows up in multiple rows due to grades received in different subjects. I am trying to calculate the Average GPA in Power BI using DAX, I am still a beginner when it comes to DAX calculations. I am providing a table below along with my formula. Can someone please tell me what am I doing wrong here?

Average(values(tbl[GPA]),DistinctCount(tbl1[ID])))

I am attaching a sample here below: enter image description here

Upvotes: 2

Views: 1393

Answers (2)

Ben
Ben

Reputation: 493

Instead of Average, use AverageX as below

AVERAGEX(VALUES(tbl1[ID]), CALCULATE(AVERAGE(tbl1[GPA])))

enter image description here

Upvotes: 2

Sanchit Sood
Sanchit Sood

Reputation: 81

  • You can use the "Average" option as per the screenshot.
  • Or just create a measure = Average(tbl[GPA]) and use it.

enter image description here

Upvotes: 1

Related Questions