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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
majo23
Frequent Visitor

How to get the Total and Subtotal without Average Calculation

Hi everyone,

So Im doing some measures in DAX, but for the total it shows me the average and not the total of each class (and unit)

I thing the problem is that Im using AVERAGE in the measure, but I dont know how to get the number for each without sum it (I was trying to used something like VLOOKUP) but that only works for columns measure Example Avegare.pbix

majo23_0-1687832443535.png

In the original report Im also having the same problem with the Revenue measure 

majo23_2-1687832656606.png

The calculation that Im using for the Revenue is 

Revenue = CALCULATE(AVERAGE('Table'[Cut]) / 5 * COUNT('Table'[Units]))

For the Class part, I need to sum all the measures that I get in the Packages, but because I have differents Cut and Rate the calculations doesnt work 

majo23_3-1687832814858.png

If someone have any suggestion, I would appreciated

MJ

 

 

 

3 REPLIES 3
LukeVanLaar26
Regular Visitor

@majo23 

Try these:

 

Rate = 
VAR _Packages = VALUES('Table'[PackageID])
RETURN
SUMX(_Packages,CALCULATE(AVERAGE('Table'[Rate])))

Revenue = 
VAR _Packages = VALUES('Table'[PackageID])
RETURN
SUMX(_Packages,CALCULATE(DIVIDE(AVERAGE('Table'[Cut]), 5) * COUNT('Table'[Units])))

 

 

Let me know if that isn't what you were looking for.

 

Connect on LinkedIn

I get the same result 

majo23_0-1687842407757.png

 

@majo23 

In your first post you were showing Class at the top of the hierarchy and indicated you wanted to calculate at the package level and sum to the class level. In this latest post you are showing Package at the top and are indicating you want to calculate at the Unit and roll up to the above levels:

 

Modify the measures I gave before to this (swapping Package for Units):

Rate Measure = 
VAR _Units = VALUES('Table'[Units])
RETURN
SUMX(_Units,CALCULATE(AVERAGE('Table'[Rate])))

 

Is that what you are looking for?

LukeVanLaar26_0-1687868155603.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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