cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

New Member

## Measure to get the SUM of an Average in a Matrix

I have a Matrix thats aggregating power generated against a windspeed (binned value)

The matrix subtotal shows the average of the whole data once filters are applied. Is there any way to calculate the sum of each row of the matrix (when each row contains an average). So the the column with the total saying 51.7. I need a measure where it sums each row in that matrix and gives me (with the selected slicers and filters): 154.15

I would need this measure to be divided by a constant and displayed as a score card so it doesnt have to show up in the matrix

I hope the screenshots suffice, it would take significant amount of time for me to recreate this with dummy data to be able to share the pbix but if thats whats needed then let me know.

1 ACCEPTED SOLUTION
Super User

Hi,

Does this measure work?

=SUMX(VALUES(Data[Wind speed [m/s]]),[Average of WT14_P_Avg])

Regards,
Ashish Mathur
http://www.ashishmathur.com
3 REPLIES 3
Super User

Hi,

Does this measure work?

=SUMX(VALUES(Data[Wind speed [m/s]]),[Average of WT14_P_Avg])

Regards,
Ashish Mathur
http://www.ashishmathur.com
New Member

I think the average per windspeed column was wrong. it had SUM instead of Average:

probably something i messed with while tinkering

[WT14_P_Avg average per Wind Speed [m/s]]] =
AVERAGEX(
KEEPFILTERS(VALUES(DATA[Column 2])),
CALCULATE(AVERAGE('DATA'[WT14_P_Avg]))
)

It seems to be working. i'll play around and mark it as solution once confirmed. Thanks
New Member

This is the closest i can get to work:

Tot = SUMX(values(DATA[Column 2]),DATA[WT14_P_Avg average per Wind Speed [m/s]]])
Wind speed is coming from a difference table thats linked via relationship but the column 2 has similar data so ive changed that here hence DATA[Column 2])

what this is doing is giving me the sum of the entire column. not the sum of the average per windspeed (even though thats what the measure says)

second thing to note is that i dont see any WT14_P_Avg average per column 2]  but i went ahead and changed that measure (didnt see a difference in results but thats to be expected because they have similar data)
Attached 2 screenshots below - the scorecard on the top is the measure. in one screenshot ive changed the aggregation to sum of WT14_P_Avg to show what the measure is actually calculating

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors