- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Calculating average values based on filter
I want to calculate one total weighted average based on all entries in a table that responds to user selected filters on the table.
In these tables the quantity is the weight and hardiness is the base value.
So for table 1 the weighted avg would be 4.1785
But for table 2 the overall average would be 3.625
How could I show a weighted average for all fields in a filtered table?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @MulberyPie ,
Assuming I have your logic right - I think the answer you are expecting is 4.107 when nothing is selected? If so the following should work.
Weighted Avg =
Var Plantvalue = SUMX(Plants, Plants[Quantity]*Plants[Hardiness ])
Var Quantity = SUM(Plants[Quantity])
Var result = Plantvalue / Quantity
Return
result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @MulberyPie ,
Assuming I have your logic right - I think the answer you are expecting is 4.107 when nothing is selected? If so the following should work.
Weighted Avg =
Var Plantvalue = SUMX(Plants, Plants[Quantity]*Plants[Hardiness ])
Var Quantity = SUM(Plants[Quantity])
Var result = Plantvalue / Quantity
Return
result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Sorry, I'm not super familiar with PowerBI is that a DAX function? Where would I use that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I think I figured it out. I'm assuming that it would be put into a new measure 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @MulberyPie, sorry should have stated in my original message! Yes it's a new measure.
Hope the measure helped, if it addressed your problem please mark it as a solution!

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
05-28-2024 03:59 AM | |||
Anonymous
| 03-07-2024 08:14 AM | ||
06-13-2024 04:11 AM | |||
07-25-2024 10:54 AM | |||
05-04-2024 12:08 PM |
User | Count |
---|---|
90 | |
77 | |
63 | |
47 | |
39 |
User | Count |
---|---|
118 | |
85 | |
80 | |
58 | |
40 |