Calculate Field in Power Pivot using DAX

powerwill

Board Regular
Joined
Sep 14, 2018
Messages
62
Office Version
  1. 365
Platform
  1. Windows
Hello,

Office 365 user here.

1668268373654.png


With a Regular Pivot, I will not take an average of the 'Score%', doing so would be incorrect, hence I use a 'Caclulated field' to show the result obtained by dividing 'Marks Obtained/Total Marks'.

I have now moved my data to a Power Query/Data Model, as I want to use Power Pivot Measures, and I understand the 'Calculated Field' will not work there and is greyed out.

I need to replicate this in DAX, so that my PowerPivot - Measure would do exactly this: 'Marks Obtained/Total Marks' for each student.

My Expression in the 'Measures' window looks like this: =AVERAGE(Query1[Marks Obtained]/Query1[Total Marks]) and it throws an error.

"This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

Any help is appreciated!
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Good to hear you figured it out yourself.

If you would like to post the solution then it is perfectly fine to mark your post as the solution to help future readers. Otherwise, please do not mark a post that doesn't contain a solution.
 
Upvote 0
@smozgur apologies. will keep this in mind.

So I created two seperate measures to SUM the Total Marks & Marks Obtained. Then used the DIVIDE fx in DAX to get the actual score.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top