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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ZeeGee
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.

 

 

 

ZeeGee_2-1654126122922.png

 

 

ZeeGee_1-1654125856231.png

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/

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

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
ZeeGee_0-1654129883411.png

 

ZeeGee_1-1654130187032.png

 

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors